MySQL Comment Mysql Adding comments

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!

Example

There are three types of comment:

 # This comment continues to the end of line

-- This comment continues to the end of line

/* This is an in-line comment */ 

/*
This is a
multiple-line comment
*/

Example:

SELECT * FROM t1; -- this is comment

CREATE TABLE stack(
    /*id_user int,
    username varchar(30),
    password varchar(30)
    */
    id int
);

The -- method requires that a space follows the -- before the comment begins, otherwise it will be interpreted as a command and usually cause an error.

#This comment works
/*This comment works.*/
--This comment does not.


Got any MySQL Question?