Single line comments start with --
.
Any text between -- and the end of the line will be ignored (will not be executed).
The following example uses a single-line comment as an explanation:
Example
--Select all:
SELECT * FROM Customers;
SELECT * FROM Customers;
The following example uses a single-line comment to ignore the end of a line:
Example
SELECT * FROM Customers -- WHERE City='Berlin';
The following example uses a single-line comment to ignore a statement:
Example
--SELECT * FROM Customers;
SELECT * FROM Products;
SELECT * FROM Products;
Practice Excercise Practice now