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 trialChristian Damm
26,486 Pointsquery with limit
Next Code Challenge is asking for:
"Get the 101st to 200th actor from the actors table. (No need to use any ordering)."
Whats wrong with my query?
select * from actors limit 10 offset 100;
3 Answers
Alex Heil
53,547 Pointshi christian, you're actually pretty close with your answer ;)
have a closer look at the first part of your statement: limit 10 - while the question wants you to return from 101 to 200 (that would be 100 items). I guess you already see the issue (perhaps a typo), right?
the full code at the end would correctly look like this:
select * from actors limit 100 offset 100;
hope that helps and have a nice day ;)
Christian Damm
26,486 PointsOh man, hello blindness!!
Thanks a lot.
samanthagiroir
3,685 PointsI am having trouble with this one also and I just put in your exact response and it still kicks back that it is wrong, although I thought the answer would have been:
select * from actors limit 100 offset 99;
since it will start at 101 and then only print to 200.
Mai Lon Ross
5,891 PointsVery close. It would be offset 100 to get the 101st row, as the count starts at 0. Just go back 1 count rather than 2.