Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialAbhilasha jangid
2,925 Pointsis a keyword that can be used in conjunction with LIMIT to page through results.
what is a keyword that can be used in conjunction with LIMIT to page through results.
1 Answer
Ben Glazier
7,741 PointsHi Abhilasha
There sure is. It's OFFSET. You can use this to effectively paginate results.
For example, if you wanted to LIMIT the results to 20 'per page', but return page 3, your SQL code would look something like the below:
SELECT * FROM users LIMIT 20 OFFSET 40;
The results returned would be limited to 20, but starting from position 40, therefore showing you the 3rd set of 20 results.
Hope this helps. Let me know if I've misunderstood your question.
Ben