MCQs Test!! VB Basic Test !! Essentials of VB !! Creating User Services !! function !! Anatomy !! GK March-2019 !! DATA TYPES IN JAVA !! Classes ,Constructor ,Methods,Inheritance !! Ecology-I !! Biology 2019 !! Gk april 2019 !! Biology (living world) !! Plant anatomy !! CELL STRUCTURES AND FUNCTION !! General biology !! Human physiology !! Data structure !! Ecology-II !! GK TEST !! Reproduction in plants !! Human reproduction !! The ABC of C !! Operating system set1 !! Operating system set2 !! Gk and current affairs !! Animal kingdom !! Number system !! Animal kingdom-II !! Gk TEST-III !! Number series !! Microorganisms !! Interview question in c !! Time and Work !! Percentage !! General history !! Average !! Cells !! Locomotion and Movement !! paging !! Bacteriology !! Page replacement policy !! Secondary memory and Disk scheduling !! Introduction of Nervous System and neurons !! Plant harmones !! Transport and Mineral Nutrition in Plants !! Neurotransmitters !! Modern Indian History !! Photosynthesis in Plants !! Modern Indian History-II !! Plant respiration !! Environment & Biodiversity !! Environment & Biodiversity - II !! Algae, Bryophytes, Pteridophytes !! Area !! Cricket !! Days of the Year (India and the World) !! Plant Pathology - I !! Indian Transport System !! Plant Pathology - II !! Aptitude !! Biology !! Botany !! C language !! Computer Science !! Core Java !! Gate !! GK !! Mysql !! Operating system !! Physics !! VB-Visual Basic !! Zoology

MySQL

Alias in MySQL
Previous Home Next

Alias is use to create an assumed name, but that can be temporarily a table or a column heading.

Syntax for columns

SELECT columnname AS alias_name
FROM tablename  
WHERE Clause ;

Syntax for table

SELECT columnname 
FROM tablename  AS alias_name
WHERE Clause ;

Here we have shown some examples

Example

SELECT fname as Name
FROM studinfo ;

 

Making alias of more than one column in a single command.

Example

SELECT fname as Name , lname as lastname 
FROM studinfo ;

The where condition also use to filter the results according to the specifird conditions

Example

SELECT fname as Name , lname as lastname 
FROM studinfo 
WHERE sid > 105;

In the above code we can also use the Order by conditions.

we can also create an alias on a table, the alias for the table is called table alias. Like the column alias, the 'AS' keyword is optional so you can omit it also. We can use the table alias in those statement that contains INNER JOIN, LEFT JOIN, self join clauses, and in subqueries.

Previous Home Next