Alias in MySQL
Alias in MySQL
DESCRIPTION
MySQL ALIASES can be used to create a temporary name for
columns or tables.
SYNTAX
The syntax to ALIAS A COLUMN in MySQL is:
column_name [ AS ] alias_name
OR
table_name [ AS ] alias_name
Parameters or Arguments
column_name
The original name of the column that you wish to alias.
table_name
The original name of the table that you wish to alias.
AS
Optional. Most programmers will specify the AS keyword when
aliasing a column name, but not when aliasing a table name.
Whether you specify the AS keyword or not has no impact on
the alias in MySQL. It is a personal choice in MySQL, unlike
other databases. (Our examples will use AS when aliasing a
column name but omit AS when aliasing a table name.)
alias_name
The temporary name to assign to the column or table.
Note:
For example:
For example: