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!
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 trial
Carter Stahl3,767 Points
Ordering the Result Set Challenge
What am I doing wrong?! Get the 11th to 30th movie from the movies table. (Again no need to order the results).
'''SELECT * FROM movies LIMIT 10 OFFSET 1;'''
Peter Ramsing16,814 Points
SELECT * FROM movies LIMIT 20 OFFSET 10;
By setting your
OFFSET to 10, that means it will start the count at 11 and then you are counting 20 units, thus this will display the movies between 11 and 30.
Robert BojorCourses Plus Student 29,439 Points
SELECT * FROM movies LIMIT 10, 20
should do the trick... since the limit is just like an array, 0 indexed, by specifying 10 as the first parameter you start from the 11th entry and the second parameter is the slice size, in this case 20, to get to the 30th entry and include it as well in the result.