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 trialMr Matthew Cooke
2,161 PointsSQL playground, stage 3 -- Who are the actors with the ids of 12127, 6901, 2071 and 2831?
Heya, I can't work it out :@( maybe because its last thing on a friday..?
-- Who are the actors with the ids of 12127, 6901, 2071 and 2831?
SELECT * FROM actors WHERE id = 12127;
1 Answer
Steven Parker
231,261 PointsRemember, when you want to test for more than one value, you use IN.
SPOILER ALERT
SELECT * FROM actors WHERE id IN (12127, 6901, 2071, 2831);
You could also do it with equality tests combined with OR, but it's more verbose:
SELECT * FROM actors WHERE id = 12127 OR id = 6901 OR id = 2071 OR id = 2831;
Aaren Isabel
6,842 PointsThanks, Steven! I was using "IS instead of "IN" in front of the parentheses and I kept getting a "Error: row value misused".
Juan Trujillo
9,391 PointsJuan Trujillo
9,391 PointsTry:
SELECT * FROM actors WHERE id IN (12127, 6901, 2071, 2831)