Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is the 'as' keyword required in Oracle to define an alias?

Is the 'AS' keyword required in Oracle to define an alias name for a column in a SELECT statement?

I noticed that

SELECT column_name AS "alias" 

is the same as

SELECT column_name "alias" 

I am wondering what the consequences are of defining a column alias in the latter way.

like image 680
Jonathan Avatar asked Dec 09 '11 20:12

Jonathan


People also ask

Do you need to use AS in SQL for alias?

The SQL AS keyword is used to define a column alias. It's also an optional keyword. If it's optional, should you use it? I recommend that you do.

Does Oracle support AS alias?

Description. Oracle ALIASES can be used to create a temporary name for columns or tables. COLUMN ALIASES are used to make column headings in your result set easier to read.

What is alias in Oracle?

Oracle table alias. Similar to a column name, you can assign a table name an alias. A table alias is a temporary name for a table in a query. You specify a table alias after the table name either with or without the AS keyword: table_name AS table_alias table_name table_alias.

What is alias keyword?

The alias keyword is used to indicate an external alias. When you need to use several versions of the same assembly or assemblies with the same full qualified typenames, you need to use the alias and extern keywords to give different alias names for each version.


1 Answers

According to the select_list Oracle select documentation the AS is optional.

As a personal note I think it is easier to read with the AS

like image 189
Roger Lindsjö Avatar answered Oct 18 '22 04:10

Roger Lindsjö