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 trialCedric Kehi
1,078 PointsGet the 101st to 200th actor from the actors table. (No need to use any ordering).
Hi, Can anyone help with question?
here is the code which i think is correct but not seem to be working:
SELECT * FROM actors LIMIT 100, 200;
Bryan Guillen
1,051 Pointshi,
I am getting error for this question too, and this thread didn't clarify much for me...
can someone help..
here's my sql..
SELECT * FROM actors LIMIT 100 OFFSET: 1 ;
Why is not that working?
2 Answers
Rich Donnellan
Treehouse Moderator 27,708 PointsCedric,
I think you're misunderstanding the value(s) in the "short-hand" LIMIT
statement. Think of it like this:
SELECT * FROM table_name LIMIT 10 OFFSET 59; // LIMIT (give me 10 rows of results), OFFSET (starts counting at 60)
SELECT * FROM table_name LIMIT 59, 10; // OFFSET, LIMIT
Remember that we start counting rows at zero!
Hope this helps!
masterpowers
3,061 PointsSELECT * FROM actors LIMIT 100 OFFSET 100;
Rich Donnellan
Treehouse Moderator 27,708 PointsRich Donnellan
Treehouse Moderator 27,708 PointsFixed your formatting. From the Markdown Cheatsheet: