2.5 SQL Comments

You may go back to some historical query and modify the query to retrieve some new data. Comments can help you remember what you were doing and why. You can also use the comments to mute the expression of some code, frequently referred to as commenting out code. This technique helps you troubleshoot some of the issues you have with your query. You can effectively get rid of parts of your query without actually getting rid of the statements themselves. And then bring them back in one by one to see where your query goes awry.

There are two ways of comment.

  1. Single line
SELECT Id, 
-- Brand,
ShoeTypes,
Color,
Price,
Descp
FROM Shoes

The above code uses -- to comment out Brand,

  1. Section
SELECT Id, 
/* Brand,
ShoeTypes,
Color, */
Price,
Descp

You can use a combination of a backslash(\) and an asterisk(*). What this is effectively saying is, don’t run anything between the two backslashes and the asterisk.