MySQL database technology (17) [group chart] _ MySQL

Source: Internet
Author: User
MySQL database technology (17) [group chart] 3.7 Add comments

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" 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 MySQL 3.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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.