Monday 31 January 2022

How can I add comments in MySQL?

Single line comment by using -- 
SELECT * FROM pm_msg_queue_txn
where 1=1
-- and api_id ='PAYMENT-BOOKINGS'
and source_id ='1035868'
order by creation_date desc;

Single line comment by using #
SELECT * FROM pm_msg_queue_txn
where 1=1
#and api_id ='PAYMENT-BOOKINGS'
and source_id ='1035868'
order by creation_date desc;

Multi line comment by using /*........*/
SELECT * FROM pm_msg_queue_txn
where 1=1
/*and api_id ='PAYMENT-BOOKINGS'
and source_id ='1035868'*/
order by creation_date desc;