Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to use top in Mysql

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 631
    Comment on it

    Hello Reader's if you want to use top in your MySql query then this blog is very helfull to you. Lets see how to use top clause in MySql in different different location.

    Suppose if you want to get only first 5 records of the table, Then you can use top clause in this way:-

    SELECT TOP 5 * FROM MyStudent;
    

    Output of this will give you first 5 records from MyStudent table.

    Now let's talk about big and bigger database, having records of hundreds of thousands entries. In this situation you can use % records filtration by using top clause. And it's code will go like this:-

    SELECT TOP 5 PERCENT * FROM MyStudent;
    

    In this case above case your selection will process on only top 5% records of the whole table. And you will only get top 5% amount of the records from the table.

    So by these two different way you can use top clause according to your need. It's fast and new feature of Mysql.

 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: