Friday, March 03, 2017

Alias in SQL

Posted by AnithaKamatchi on Friday, March 03, 2017 in | No comments

Usage : 

Assign temporary alias name to columns and table

How the Alias works????

Consider the table "Student_List"  as shown below
















Case 1:

Retrieve all the columns in the table "Student_List" replacing student with participant for all the columns

Syntax:
Select <column name> as <alias name> from table <table_name>

Sample Query:
select student_id as "Participant_id",
student_name as "Participant_name",
student_age as "Participant_age",
student_grade as "Participant_grade",
skills as "participant_skill" from student_list

Result:







Note: we can have atmost 30 characters for alias name

0 comments:

Post a Comment