Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MySQL LIMIT/OFFSET: get all records except the first X

Tags:

mysql

limit

I want to query all records from number 50 and up. So instead of doing something like LIMIT 49, 99999 I want to know if there is an official way.

like image 854
priktop Avatar asked Apr 11 '11 09:04

priktop


1 Answers

No, sorry. From the MySQL Documentation:

To retrieve all rows from a certain offset up to the end of the result set, you can use some large number for the second parameter. This statement retrieves all rows from the 96th row to the last:

SELECT * FROM tbl LIMIT 95,18446744073709551615;
like image 112
Konerak Avatar answered Oct 15 '22 11:10

Konerak