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.
Popular Posts
-
Learning about Events Visual Basic is "Event Driven" language. What does it mean? Everything that happening, launch an event. You...
-
Methods A Method is a procedure built into the class. They are a series of statements that are executed when called. Methods allow us to han...
-
Input/Output with files C++ provides the following classes to perform output and input of characters to/from files: * ofstream: Stream c...
-
Working With Integers (Continue) Question: What will be printed on the form after executing the following code: Dim Blah As Integer Print Bl...
-
Getting Started Note that all the images in this tutorial taken from Visual Basic version 6.0. If you using other version of Visual Basic, t...
-
SQL Server (and SQL Server Express) supports two authentication modes: 1. Windows Authentication mode 2. Mixed Mode (Windows Authentication ...
-
Changing the button's Properties Now you have a button on your form. You can change its location by dragging it, and change its size by ...
-
Friendship and inheritance Friend functions In principle, private and protected members of a class cannot be accessed from outside the same ...
-
Conditional Statements If....Else statement If conditional expression is one of the most useful control structures which allows us to execut...
-
Abstract Classes An abstract class is the one that is not used to create objects. An abstract class is designed to act as a base class (to b...
No comments:
Post a Comment