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 trialMark Mazur Lussenburg
25,338 PointsChallenge task 2 relational databases SET OPERATIONS
The task is about finding 'name' from the respective 'vegetable' and 'fruit' table, but only finding the items that starts with the letter A through K.
my code looks like this;
SELECT name FROM fruit UNION SELECT name FROM vegetable WHERE name < "L";
i have no idea why this don't work, as it works with other tables in the SQL playground.
//E
2 Answers
Shaun Sweeney
6,216 PointsSELECT name FROM fruit WHERE name < "L" UNION SELECT name FROM vegetable WHERE name < "L";
Mark Mazur Lussenburg
25,338 Pointsoh i see, there should be a where clause on both parts of the select, thanks! :D
Troy Erby
6,332 PointsTroy Erby
6,332 PointsI actually wrote the same line of code when I attempted the challenge and got the following error:
"Your UNION queries didn't bring back a union of fruits and veggies beginning with the letters A through K!"
I also have no idea why this doesn't work