SQL Alias
SQL Aliases are defined for columns and tables. Basically aliases is created to make the column selected more readable.
For Example: To select the first name of all the students, the query would be like:
Aliases for columns:
SELECT first_name AS Name FROM student_details;
or
SELECT first_name Name FROM student_details;
In the above query, the column first_name is given a alias as 'name'. So when the result is displayed the column name appears as 'Name' instead of 'first_name'.
Aliases for tables:
SELECT s.first_name FROM student_details s;
In the above query, alias 's' is defined for the table student_details and the column first_name is selected from the table.
Aliases is more useful when
• There are more than one tables involved in a query,
• Functions are used in the query,
• The column names are big or not readable,
• More than one columns are combined together
Subscribe to:
Post Comments (Atom)
VMware Cloud Learning Video's
Here is a nice summary list of all VMworld US 2018 Breakout session with the respective video playback & download URLs. Enjoy! Bra...
-
Different types of bra Welcome to this post, we are here to help you with the different types of bras out there and help you make the ...
-
Most of women now days are very conscious about their future. Time has changed now women are now doing much better than men in corporate w...
-
Mens Fashion Wear Hugo Boss is one of the leading designers of high-end menswear in the world today, but the company has a checkered ...
No comments:
Post a Comment