mysql comment code example

Example 1: mysql comment

-- This is a SQL Comment

/* 
This is a multi-line
SQL comment 
*/

Example 2: how do we write comments in myql

mysql comments

Example 3: how do you comment in mysql workbench

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
multiple-line comment
*/
1;

Example 4: comments in mysql

#this is a comment
-- this is a comment but requires a whitespace/tab/newline after the double -