Bookmark and Share

SQL - As

SQL AS temporarily assigns a table column a new name. This grants the SQL developer the ability to make adjustments to the presentation of query results and allow the developer to label results more accurately without permanently renaming table columns.

Advertise on Tizag.com

SQL Select As Code:

USE mydatabase;

SELECT day_of_order AS "Date", 
customer As "Client", 
product, 
quantity
FROM orders;

SQL Orders Table Results:

DateClientproductquantity
2008-08-01 00:00:00.000TizagPen4

SQL AS allows us to use any name at the presentation level and helps the developer better describe a column in the result set.

SQL Select Arithmetic Query:

USE mydatabase;

SELECT (5 + 12) AS "5 plus 12 is"

SQL Arithmetic Results:

5 plus 12 is
17
Bookmark and Share




Found Something Wrong in this Lesson?

Report a Bug or Comment on This Lesson - Your input is what keeps Tizag improving with time!

Advertise Here

More Tutorials!
Microsoft Office Tutorials Artist Tutorials