How can I add comments in MySQL?

amir amir picture amir amir · Feb 1, 2012 · Viewed 130.5k times · Source

I want to add comment in SQL code. How can I do this? I'm using MySQL.

Answer

Martti Laine picture Martti Laine · Feb 1, 2012

Several ways:

# Comment
-- Comment
/* Comment */

Remember to put the space after --.

See the documentation.