Writing Comments

MySQL allows you to intersperse comments with your SQL code. This can be useful for documenting queries that you store in files. You can write comments in two ways. Anything from a '#' character to the end of a line is considered a comment. C-style comments are allowed as well. That is, anything between '/*' and '*/' beginning and ending markers is considered a comment. C-style comments may span multiple lines:

# this is a single line comment
/* this is also a single line comment */
/* this, however,
   is a multiple line
   comment
*/

As of MySQL 3.23, you can "hide" MySQL-specific keywords in C-style comments by beginning the comment with '/*!' rather than with '/*'. MySQL looks inside this special type of comment and uses the ...

Get MySQL now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.