Column Alias
Description:
Illustrates the SQL Server syntax for the column alias options.
Syntax:
SYNTAX:
SELECT [ ALL | DISTINCT ]
[TOP ( expression ) [PERCENT] [ WITH TIES ] ]
column1 AS displayname1, displayname2 = column_name2, column_name3 displayname3
[ INTO new_table ]
[ FROM { table_source } [ ,...n ] ]
[ WHERE search_condition AND search_condition ]
[ GROUP BY ]
[ HAVING search_condition ]
PURPOSE:
Column Alias allows you to change column headings and also allows
you to group several columns into one.
There are three ways to do this:
1. AS column_name AS new_column_header
2. new_column_header = column_name or expression
3. column_name new_column_header