Monday, 2 July 2012

SQL Server Alias

SQL Alias


You can give a table or a column another name by using an alias. This can be a good thing to do if you have very long or complex table names or column names. An alias name could be anything, but usually it is short.


Syntax

SELECT column_name FROM table_name AS alias_name

Example:-

SELECT pro_ord.OrderID, per.LastName, per.FirstName FROM Persons AS per,Product_Orders AS pro_ord WHERE per.LastName='solanki' AND per.FirstName='mayank'

No comments:

Post a Comment