Reputation: 9183
If I want to select , let's say, 5 records, I do this:
SELECT * FROM mytable LIMIT 5
If I want to add an offset, I do this:
SELECT * FROM mytable OFFSET 5 LIMIT 5;
But what should I do if I want to offset from a specific id? Something like this:
SELECT * FROM mytable OFFSET FROM id = 30 IMIT 5
Upvotes: 0
Views: 150
Reputation: 1269873
Using limit
without an order by
is to be discouraged. Let me assume this is what you want:
select *
from mytable
where id >= 30
order by id
limit 5;
Upvotes: 1