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:
-- Select all:
SELECT * FROM Customers;
SELECT * FROM Customers;
The following example uses a single-line comment to ignore the end of a line:
SELECT * FROM Customers -- WHERE City='Berlin';
The following example uses a single-line comment to ignore a statement:
-- SELECT * FROM Customers;
SELECT * FROM Products;
SELECT * FROM Products;
Practice Excercise Practice now