Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in SQL by (20.3k points)

I would like to construct a query that displays all the results in a table but is offset by 5 from the start of the table. As far as I can tell, MySQL's LIMIT requires a limit as well as an offset. Is there any way to do this?

1 Answer

0 votes
by (40.4k points)

To retrieve all the rows from a certain offset up to the end of the result set, you need to use some large number for the second parameter. 

The below statement can retrieve all the rows from the 96th row to the last:

Query:

SELECT * FROM tbl LIMIT 95, 18446744073709551615;

For detailed information, refer to this MySQL Manual on LIMIT

Related questions

0 votes
1 answer
asked Dec 17, 2020 in SQL by Appu (6.1k points)
0 votes
1 answer
asked Jul 9, 2019 in SQL by Tech4ever (20.3k points)
0 votes
1 answer
0 votes
1 answer
asked Dec 31, 2020 in SQL by Appu (6.1k points)
0 votes
1 answer

Browse Categories

...