Yung Kazi6,997 Points
Keyword OFFSET I am actually confused about what OFFSET is doing. [SOLVED]
My understanding is the syntax for using OFFSET is: SELECT <column> FROM <table> LIMIT <# of rows> ASC | DESC OFFSET <skipped rows> On the exercise, I used the limit as ten but then got confused on what my skipped rows would mean so I tried ten on that as well and that worked.
I want to understand why 10 worked for skipped rows and why using OFFSET is a good practice in SQL, thank you.
Showing a practice example would mean a lot.
Tommy Gebru28,819 Points
So for this challenge, we are looking to display 10 queries at a time, with the limit by 10 statement and then of course we want to offset or begin the records on the second page of results, or rather we will exclude the first 10
SELECT * FROM books ORDER BY title ASC LIMIT 10 OFFSET 10;
Therefore our sql code will select rows 11-20. This will be easier to experiment with in the SQL playground, when you can open up a recent workspace and try out the OFFSET keywords for real time results