Column Aliases
Column aliases are temporary names that are given to the columns for specific queries this makes output data more readable and easy to understand especially when dealing with complex queries like join queries and also refers to columns more easily in GROUP BY, ORDER BY, and WHERE clauses. Column aliases are defined in the SELECT statement. Let’s see the example
SELECT employee_id ID, first_name AS FirstName, last_name AS LastName FROM employees;
In this above example the column aliases ID, FirstName, and LastName are assigned to the columns employee_id, first_name, and last_name. When the query is executed, the result set will display these aliases in the table instead of the original column names(employee_id,first_name,last_name) which the enhancing readability.
Output:
SQL Server ALIASES
Aliases in SQL Server are the temporary names given to tables or columns to make it easy to read and maintain the data. Aliases help you to provide different names to columns and tables temporarily so that users can easily understand the data of the table and it does not change any data of the table or column. Using aliases complex joins of multiple tables are easy to read and understand so that you perform other operations on columns and tables easily.
Contact Us