Description of MySQL statement comments and mysql statement comments

Source: Internet
Author: User

Description of MySQL statement comments and mysql statement comments

MySQL supports three annotation methods:

1. Start the '#' character from the end of the line.

2. 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 ).

3. From the/* sequence to the */sequence following it. 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:

// In mysql, how to write the comment statement mysql> SELECT 1 + 1; # This comment ends until the end of the line mysql> SELECT 1 + 1; -- This annotation ends until the end of the row. mysql> SELECT 1/* This is a comment in the middle of the row */+ 1; mysql> SELECT 1 +/* This is a multi-line comment form */1;

The preceding annotation syntax applies to how the mysqld server analyzes SQL statements. Before being sent to the server, the mysql client program also executes partial statement parsing. (For example, it determines the statement boundary in multiple statement lines through parsing ).

Summary

The above is all about the MySQL statement annotation method in this article. If you are interested, refer to: join for MySQL optimization) examples of optimization techniques used to replace subqueries, MYSQL subqueries, and nested query optimization instances, and slow subqueries using mysql in statements. If you have any shortcomings, leave a message to indicate that, the editor will reply to you and make corrections in a timely manner, hoping to help you.

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.