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 */".
The operating environment of this tutorial: windows7 system, mysql8 version, Dell G3 computer.
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)
NO2 : #Comment content
This comment method cannot implement multi-line comments.
NO3: /*Comment content*/
This kind of comment Ability to implement multi-line comments.
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.
[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!