Welcome to the Treehouse Community
Looking to learn something new?
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.