How will you limit a MySQL query to display only top 10 rows?

We can use LIMIT clause in MySQL to limit a query to a range of rows.

Following query will give top 10 rows from the table with table_name:

SELECT * FROM

<

table> LIMIT 0,10;

Following query will give 6 rows starting from the 4th row in table with table_name:

SELECT * FROM

<

table> LIMIT 3,6;

Read the full book at www.amazon.com
Posted in MySQL, MySQL Interview Questions

Leave a Reply

Your email address will not be published. Required fields are marked *

*