In addition to referring to a column by name, an SQL query can reference a column by an alias. Column aliases are used for join indexes when two columns have the same name. However, an alias can be used for any column when a pseudonym is more descriptive or easier to use. Using an alias to name an expression allows a query to reference the expression.
You can specify a column alias with or without the keyword AS on the first reference to the column in the query. The following example creates and uses aliases for the first two columns.
SELECT departnumber AS d, employeename e, salary FROM personnel.employee WHERE d IN(100, 500) ORDER BY d, e ;
Alias names must meet the same requirements as names of other database objects.
The scope of alias names is confined to the query.