Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • SQL First ( ) function

    • 0
    • 1
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 205
    Comment on it

    If you want to select first coulmn from a table in database then you can do with first ( ) function . It return the first column from a table .
    Syntax ->

    select first ( col_name ) from table_name ; // This is valid for Ms Access Database only 
    

    For Another Database you have to write other statement , given below

    select first ( col_name ) as first_student from student ;
    

    Example ->

     **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 you want to get the first value of student_name column from student table then you can do with First ( ) function

    **select first ( Student_name ) as first_student from student ;** // After execution
    

    Output ->

    **Student_name**     **Student_Age**    **Student_Id**
          Mukesh                23              1
    

 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: