三种注释
mysql> SELECT 1+1; # This comment continues to the end of line
mysql> SELECT 1+1; -- This comment continues to the end of line
mysql> SELECT 1 /* this is an in-line comment */ + 1;
mysql> SELECT 1+
/*
this is a
multiple-line comment
*/
1;
特殊语法——执行 MySQL 特有功能
变种的 "/**/" 风格注释
/*! MySQL-specific code */
SELECT /*! STRAIGHT_JOIN */ col1 FROM table1,table2 WHERE ...
CREATE /*!32302 TEMPORARY */ TABLE t (a INT);其中第三条表示当版本大于 32302 时注释中的语句才生效。
References