SQL Server: Using Alias Name with Select Statement

The Alias name is the name that is referred to any column name or table name that is given by user. The alias name also used to represent some column or table without using its real name. As we will proceed in this article we will see that how we can use both the alias column name and alias table name in SQL Server.

Before understanding the alias here we have a table that contains some records.
As we can see that there are two columns in the above table. Now we will see that how we can use the alias name for these columns.
Query: select name as EmployeeName, Salary as EmployeeSalaryHours from EmployeeMaster;

The output should be like this. As we know that the column name were Name and Salary but while displaying the content we changed the name of column and give them alias name.

Author Bio : I am Rajendra Kumar B.Tech Mechanical student, started career as a Blogger owning various blogs and one of my Favorite is T20 World 2014 .

Suggested Enrty:

Cast() Function in SQL Server
Convert() Function in SQL Server
Constraints and Type of Constraints in SQL
SQL Server Database Backup and Restore Database
Fetching Records from Multiple Tables in SQL Database
admin (157 Posts)

Leave a reply

Your email address will not be published.

Comment moderation is enabled. Your comment may take some time to appear.