MySQL

How to Comment Multiple Lines in MySQL

In this tutorial, we are going to see how to comment multiple lines in MySQL. Multi-line comment has the advantage of being able to indicate where the comment begins and ends. It is therefore possible to use it in the middle of an SQL query without any problem.
 

Example 1: How to Comment Multiple Lines in MySQL
/* This is an example of
multi-line comment which
select all data in "table1" */
SELECT * FROM table1 WHERE 1 = 1;

 

 

Example 2: How to Comment Multiple Lines in MySQL
SELECT *    /* select all */
FROM table1 /* data in "table1" */
WHERE 1 = /* mid-request example */ 1

Compatibility :

  • MySQL
  • PostgreSQL
  • Oracle
  • SQL Server
  • SQLite
mcqMCQPractice competitive and technical Multiple Choice Questions and Answers (MCQs) with simple and logical explanations to prepare for tests and interviews.Read More

Leave a Reply

Your email address will not be published. Required fields are marked *