How to annotate statements in Mysql server supports three annotation styles:
· Start from the end of the line with the '#' character.
· From the '--' sequence to the end of the row. Note that the comment style of '--' must be followed by at least one space character (such as space, tab, line break, and so on ). This syntax is slightly different from the standard SQL comment syntax, which will be discussed in 1.8.5.7, "'--' as the comment start mark.
· From/*. The end sequence is not necessarily in the same row. Therefore, this syntax allows annotations to span multiple rows.
The following example shows three styles of annotations:
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;
The preceding annotation syntax appliesMysqldHow does the server analyze SQL statements. Before sending it to the server,Mysql customersThe program also executes partial statement parsing. (For example, it determines the statement boundary in multiple statement lines through parsing ).
In MySQL 5.1,MysqlThe only limitation of parsing/*... */annotation is that the exclamation point used in conjunction with the style of annotation delimiters marks the SQL statement section with conditional execution. Suitable for interactive runningMysqlAnd put the Command into a file, and use it in batch modeMysqlTo processMysql <File_name. For more information and examples, see section 1.8.4, "MySQL extension to standard SQL ".