Top query in MySQL
If we are using SQL Server, generally we use TOP 10 to return top 10 rows of the table.
But in mysql it doesn’t work. We need to use following query to return top x result.
SELECT * FROM test.product p limit 10;
it returns top 10 records from product table. You can also define offset from where you want top 10 record. It is as follows:
SELECT * FROM test.product p limit 10 offset 10;
it returns first 10 records from 10th record.