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

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 201
    Comment on it

    Using this SQL Top statement we can select the topmost( first element from top ) element from the table in database . We can also select one or more element from the top in a table . This clause tell how many rows is returned .
    Syntax ->

    select top (number) from student ;
    

    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
    

    Now suppose i want to get 3 elements from top then we can do with Top clause
    select top 3 * from student ;

    **Student&_name**     **Student&_Age**    **Student_Id**
        Mukesh                    23                      1
        Ayush                     24                      2
        Ishan                     20                      4
    

 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: