sitebooth.blogg.se

Mysql comment single line
Mysql comment single line






mysql comment single line

The following illustrates the executable comment syntax: /*! MySQL-specific code */ Code language: SQL (Structured Query Language) ( sql )įor example, the following statement uses an executable comment: SELECT 1 /*! +1 */ Code language: SQL (Structured Query Language) ( sql ) These comments allow you to embed SQL code that will execute only in MySQL but not other databases. MySQL provides executable comments to support portability between different databases. Notice that MySQL does not support nested comments. You use this comment style to document a block of SQL code. C-style comment /**/ can span multiple lines.

mysql comment single line

ReportsTo = 1002 # get subordinates of Diane If MySQL didn’t use the whitespace, it would return 10 instead. MySQL uses a whitespace to avoid the problems with some SQL construct such as: SELECT 10-1 Note that standard SQL does not require a whitespace after the second dash. The double dash-comment style requires at least whitespace or control character (space, tab, newline, etc) after the second dash. It only executes the SQL part except for executable comment, which we will discuss in the next section. When parsing SQL code, MySQL ignores the comments part. CommentsĬomments can be used to document the purpose of an SQL statement or the logic of a code block in a stored procedure.

#MYSQL COMMENT SINGLE LINE HOW TO#

Summary: in this tutorial, you will learn how to use MySQL comment to document an SQL statement or a block of code in MySQL.








Mysql comment single line