SQL Tutorial - Learn SQL




SQL Tutorial
SQL Cheat Sheet
SQL Database Table
SQL SELECT
SQL SELECT INTO
SQL DISTINCT
SQL WHERE
SQL LIKE
SQL INSERT INTO
SQL UPDATE
SQL DELETE
SQL ORDER BY
SQL OR & AND
SQL IN
SQL BETWEEN
SQL Aliases
SQL COUNT
SQL MAX
SQL MIN
SQL AVG
SQL SUM
SQL GROUP BY
SQL HAVING
SQL JOIN
SQL Training
SQL Server
SQL Hosting
SQL Replication
ETL - Extract, Transform, and Load


SQL ALIASES

SQL aliases can be used with database tables and with database table columns, depending on task you are performing.

SQL column aliases are used to make the output of your SQL queries easy to read and more meaningful:


SELECT Employee, SUM(Hours) As SumHoursPerEmployee
FROM EmployeeHours
GROUP BY Employee

In the example above we created SQL alias SumHoursPerEmployee and the result of this SQL query will be the following:

Employee SumHoursPerEmployee
John Smith 25
Allan Babel 24
Tina Crown 27

Consider the following SQL statement, showing how to use SQL table aliases:


SELECT Emp.Employee
FROM EmployeeHours AS Emp

Here is the result of the SQL expression above:

Employee
John Smith
Allan Babel
Tina Crown

The SQL table aliases are very useful when you select data from multiple tables.



ASP Hosting




If you want to contact us please email to
contact @ sql-tutorial.net


Link to SQL Tutorial


Bookmark SQL Tutorial


Copyright


Disclaimer



  © Art Branch Inc. 2004