Skip to main content
Admissions guidance, study banks, and career tools — get started on Shalyam

Keyset Pagination

Page through Orders ordered by id with 3 rows per page without using OFFSET. Write the query that fetches the page after the last seen id 6.

Table schema

Orders(id INT PRIMARY KEY, amount INT)

Sample data

ids: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 (last seen id = 6)

Discussion

No discussions yet.

Rewards · v2.1

Get Exclusive Insights with Every Issue

Join Shalyam Newsletter

Stay ahead in education, research, and innovation—straight to your inbox.