Comments

Comments makes your sql statements easier to read and maintain.

Commnents are ignored by the system.

ctrl / - : toggles comments on or off.

Two ways to write SQL comments:

  • Begin the comment with a slash and an asterisk (/*). Proceed with the text of the comment. This text can span multiple lines. End the comment with an asterisk and a slash (*/). The opening and terminating characters need not be separated from the text by a space or a line break.

 

  • Begin the comment with — (two hyphens). Proceed with the text of the comment. This text cannot extend to a new line. End the comment with a line break.

#Renaming a column. To rename a column, write the desired name after the table name.
SELECT
col#,
segcollength,
offset,
name COLUMN_NAME,
type#,
length

FROM
col$;

#Renaming a column with the AS command.
SELECT
col#,
segcollength,
offset,
name AS COLUMN_NAME,
type#,
length

FROM
col$;

Leave a Comment

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

Scroll to Top