Home > Database > Mysql Tutorial > body text

What are the comments in mysql

青灯夜游
Release: 2021-12-31 15:38:43
Original
26744 people have browsed it

There are four kinds of comments in mysql: 1. Single-line comment "--", syntax "-- comment content"; 2. Single-line comment "#", syntax "# comment content"; 3. Multi-line comment "/**/", syntax "/*comment content*/"; 4. Inline comment "/*! */", syntax "/*! Comment content */".

What are the comments in mysql

The operating environment of this tutorial: windows7 system, mysql8 version, Dell G3 computer.

Four kinds of comments in mysql

NO1: -- Comment content

This comment method cannot implement multi-line comments. It should be noted that there is a space after --. (-- The following content will not be recognized, so you need to add a semicolon on the next line to end the statement)

What are the comments in mysql

NO2 : #Comment content

This comment method cannot implement multi-line comments.

What are the comments in mysql

NO3: /*Comment content*/

This kind of comment Ability to implement multi-line comments.

What are the comments in mysql
Insert picture description here

NO4:/*!Comment content*/

This kind of comment is called inline comment in mysql, when! When the database version number is connected later, when the actual version is equal to or higher than that string, the application will interpret the comment content as SQL, otherwise it will be treated as a comment. By default, when the version number is not connected, the content inside will be executed.

这个语句和select name,math,science from stu where total =270 union select 1,2,3的结果是相同的

[Related recommendations: mysql video tutorial]

The above is the detailed content of What are the comments in mysql. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template