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 trialAdam Tyler
14,865 PointsWhy does this need a WHERE clause?
I am getting an error saying I need a where clause, but I don't see why? I have ordered the table then used LIMIT 1 to get the top result, why would I need to do anything else?
1 Answer
KRIS NIKOLAISEN
54,971 PointsThe instructions are to find the earliest Science Fiction book in our library. So you have two criteria: a date and a genre. The ORDER BY clause can be used to get the correct date. The WHERE clause is used to filter the genre to just Science Fiction.
Adam Tyler
14,865 PointsAdam Tyler
14,865 PointsThank you!