AS Keyword In SQL
By S.Qasim
Published: 14 May 2013
Use of AS Keyword in SQL
AS Keyword In SQL
In SQL when we assign the ALIAS to any column or table then we use AS keyword. although we assign the ALIAS with out AS keyword but using As keyword is a explicit way. AS keyword place before the ALIAS Name and after the Column or table name.
For example
SELECT customer_name, SUM(payment) AS "Total" FROM payments
GROUP BY customer-name ;
In this statement Total is ALIAS which is declare with AS Keyword.
we cal also use AS keyword when we assign tha ALIAS to Table:
SELECT A.Name , SUM(A1.Fee) AS "Total Sales"
FROM Student AS A
GROUP BY A.Name ;
In Above statement first AS is used to declare column ALIAS and Second AS is used for assign the ALIAS to Table.