Can I add comments to the Queries?
Apply OS: Windows, macOS, Linux
Apply Navicat Product: All
Apply Navicat Version No.: All
MySQL & MariaDB
Yes, you can use # or /*...*/ to add comments to the queries.
Note that starting from MySQL Server 3.23.3, it supports a variant of the ‘--’ comment style. That is, the ‘--’ start-comment sequence must be followed by a space (or by a control character such as a newline).
mysql> SELECT 1+1; # This comment continues to the end of line
mysql> SELECT 1+1; -- This comment continues to the end of line
mysql> SELECT 1 /* this is an in-line comment */ + 1;
mysql> SELECT 1+
this is a
For more information, please refer to :
PostgreSQL, Oracle, SQLite & SQL Server
Yes, to add comments to the queries, please use -- or /*...*/ .