I want to add comment in SQL code. How can I do this? I'm using MySQL.
Answers
Several ways:
# Comment
-- Comment
/* Comment */
See the docs.
You can use single line comments:
-- this is a comment
# this is also a comment
Or a multiline comment:
/*
multiline
comment
*/
Three types of commenting are supported
- Hash base single line commenting using #
Select * from users ; # this will list users
- Double Dash commenting using --
Select * from users ; -- this will list users
Note : Its important to have single white space just after --
3) Multi line commenting using /* */
Select * from users ; /* this will list users */
0 comments:
Post a Comment