+ 1

Which is the correct way to comment in SQL?

I am new to SQL and currently learning from an online tutorial. I am using Mysql and PopSQL However, the following 3 ways of commenting seem to work. I want to know which one is the correct method to comment --This is a comment #This is a comment /*This is a comment*/ Also, are there specific use cases for each types of comments?

6th Oct 2022, 7:20 AM
Laxman Kamat
3 Antworten
+ 3
-- Single Line Comments /* Multi-line Comments */
6th Oct 2022, 7:24 AM
SoloProg
SoloProg - avatar
+ 2
MySQL additionally uses # for inline comments.
6th Oct 2022, 7:39 AM
SoloProg
SoloProg - avatar
+ 1
SoloProg So u mean to say # comments are not used in SQL?
6th Oct 2022, 7:25 AM
Laxman Kamat