Mysql entry Series: add notes to MYSQL [group chart] 3.7 Add notes
MySQL allows annotations in SQL code. This indicates that the query stored in the file is very useful. You can write comments in two ways. All contents starting with "#" until the end of the line are considered as comments. The other is a C-style annotation. That is, all content ending with "/*" and ending with "*/" is considered as comments. C-style annotations can span multiple lines, for example:
Since MySQL 3.23, you can "hide" the MySQL-specific keywords in the C-style annotations, and comment them with "/*!". Instead of starting. MySQL checks and uses these keywords for this special type of comment, but other database servers ignore these keywords as part of the comment. This helps you compile the code that uses the unique functions of MySQL when executed by MySQL, and the code can be used for other database servers without modification. The following two statements are equivalent to non-MySQL database servers, but if they are MySQL servers, an insert delayed operation will be executed in the second statement:
Since MySQL3.23.3, in addition to the annotation style just introduced, you can also use two dashes and a space ("--") to start the annotation; all content from the two dashes to the end of the line is processed as a comment. Some databases use double dashes as the initial comment. MySQL also allows this, but requires a space to avoid confusion. For example, a statement with an expression such as 5--7 may be considered to contain a comment, but cannot write an expression such as 5-7. Therefore, this is a useful exploration. However, this is just an exploration, and it is best not to use such style annotations.