Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to specify only start index in LIMIT in MySQL select query?

Tags:

mysql

I want to select the records from the table starting from 3rd row. How this can achieved with LIMIT?

like image 271
snew Avatar asked Dec 30 '25 19:12

snew


2 Answers

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 136
pioto Avatar answered Jan 01 '26 12:01

pioto


Like this:

SELECT * FROM MyTable LIMIT 2, 18446744073709551615;

(The offset is zero-based)

like image 38
SLaks Avatar answered Jan 01 '26 13:01

SLaks