Get the App
SLTechnology News&Howtos  ›  Database  › 

How to use comments in mysql

Shulou Source: shulou.com Published: 2022-05-31 12:09:56 10月03日 Update

This article introduces the knowledge of "how to use annotations in mysql". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

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" / *! comment content * / ".

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

Four comments in mysql

NO1:-- comment content

This annotation method does not implement multiline comments, but it is important to note that there is a space after it. (- the following content will not be recognized, so you need to put a semicolon on the next line to end the statement)

NO2:# comment content

This annotation method also does not implement multiline comments.

NO3:/* comments * /

This kind of comment can implement multi-line comments.

Insert a picture description here

NO4PUR PUBG! Comment content * /

This kind of comment is called inline comment in mysql, when! When the database version number is followed, when the actual version is equal to or higher than that string, the application interprets the comment content as SQL, otherwise it will be treated as a comment. By default, when there is no version number, the contents will be executed.

This is the end of the content of "how to use comments in mysql". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Tags: Comments content version grammar multiline practice method more knowledge practicality achievement next one line semicolon dilemma picture character string application situation Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno vpn Apple MySQL macOS Redmi