SQL Aliases

You can rename a table or a column temporarily by giving another name known as Alias. The use of table aliases is to rename a table in a specific SQL statement. The renaming is a temporary change and the actual table name does not change in the database. The column aliases are used to rename a table's columns for the purpose of a particular SQL query.

The basic syntax of a table alias is as follows.

SELECT column1, column2....

FROM table_name AS alias_name

WHERE condition;

The basic syntax of a column alias is as follows.

SELECT column_name AS alias_name

FROM table_name

WHERE condition;

Post a Comment

0 Comments