Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • SQL As statement

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 163
    Comment on it

    If we want to give temporarily name to a table then we can do easily with " as " statement .
    Sometime permanent name of table is very confusing so we need temporary name of table to make easy understanding .
    Syntax

    select old_col_name as new_col_name  from table_name ;
    

    Example ->
    Table name -> student

        **Student_name**     **Student_Age**          **Student_Id**
            Mukesh                    23                      1
            Ayush                     24                      2
            Ishan                     20                      4
            Pranav                    35                      7   
            Abhishek                  26                      8
            Ravi                      25                      3
    

    If i want to change( temporary ) the name of the table Student_name , Student_Age ;

    select Student_name as Name Student_Age as Age from student ;
    

    outpute->

           **Name**                 **Age**         **Student_Id**
            Mukesh                    23                      1
            Ayush                     24                      2
            Ishan                     20                      4
            Pranav                    35                      7   
            Abhishek                  26                      8
            Ravi                      25                      3
    

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: