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 trialStephen Garner
Courses Plus Student 11,241 PointsWhat's wrong with this?
SELECT * FROM actors LIMIT 100, 199;
3 Answers
jcorum
71,830 PointsSince there's no link to a challenge and no indication of what you are trying to do, I can only guess. But if it was to add an offset to the limit you do it this way:
SELECT * FROM actors LIMIT 100 OFFSET 199;
No comma, and the keyword OFFSET.
Steven Parker
231,261 PointsActually, your use of LIMIT
with two arguments is legitimate, but the values you used seem a bit odd based on what I remember of the challenges. Be sure that your first argument is the number of rows you want to skip, and the second argument is the number of rows you want to show.
For example, if you wanted to show the 3rd page where each page had 100 rows, you might say:
SELECT * FROM actors LIMIT 200, 100;
Stephen Garner
Courses Plus Student 11,241 PointsThis has been resolved. Solution is:
SELECT * FROM actors LIMIT 100, 100;
Problem was:
List actors starting at the 101st spot to the 200th.
I got confused because I thought it was asking for 99 actors. Not a very clearly worded question in my opinion, but hey who am I to dispute clarity of these questions?
Steven Parker
231,261 PointsI'd agree. It would have been more direct to ask for the 2nd page of a 100-per-page report. That's what I guessed you might have been dealing when I made my suggestions.