In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly introduces what notes are in mysql. It is very detailed and has a certain reference value. Friends who are interested must read it!
Mysql has three kinds of comment characters: 1, "#", indicating single-line comment, syntax "# comment content"; 2, "- -", indicating single-line comment, syntax "--comment content"; and 3, "/ * * /", indicating multi-line comment, syntax "/ * comment content * /".
The operating environment of this tutorial: windows7 system, mysql5.7.27 version, Dell G3 computer.
There are three types of MySQL comment characters:
1. # comment content, indicating a single-line comment
2. "--comment content" (note-- followed by a space)
3. / * comment content * /
In addition, you should pay attention to the following points:
/ *. * / in most programming languages are comments, and the statements in this comment are not executed. However, in order to maintain compatibility in MySQL, for example, SQL statements exported from mysqldump can be used directly by other databases, it puts some unique statements only on MySQL in / *!. * /, so that these statements will not be executed in other databases, but it will be executed in MySQL. Here, * and! There can be no spaces between them.
A statement such as "/ *! 50701 select * from test * /", where 50701 means that the statement will be executed assuming that the database server is version 5.7.01 or later.
The example is as follows:
MySQL [(none)] > / *! select count (*) from mysql.user*/;+-+ | count (*) | +-+ | 7 | +-+ 1 row in set (0.07 sec) MySQL [(none)] > / *! select count (*) from mysql.user*/;ERROR:No query specified MySQL [(none)] > / * select count (*) from mysql.user*/ ERROR:No query specified MySQL [(none)] > select @ @ version;+-+ | @ @ version | +-+ | 5.7.27-5-log | +-+ 1 row in set (0.06 sec) MySQL [(none)] > / *! 50727 select count (*) from mysql.user*/ +-+ | count (*) | +-+ | 7 | +-+ 1 row in set (0.08 sec) MySQL [(none)] > / *! 50728 select count (*) from mysql.user*/;Query OK, 0 rows affected (0.06 sec)
The MySQL server version is 5.7.27, and the final SQL statement is executed when the MySQL server version is greater than or equal to 5.7.28.
The above is all the content of the article "what are the comment symbols in mysql"? thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.