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 trial

Databases Querying Relational Databases Set Operations Set Operations

Spencer Lebel
Spencer Lebel
3,125 Points

Code Challenge Task 3

A bit stumped on how this is wrong... The error says my union statement doesn't return all values including duplicates... But I'm using UNION ALL.

Steven Parker
Steven Parker
231,248 Points

You need to show your entire statement for us to be able to identify the issue and help resolve it.

1 Answer

Text of a challenge: There are two tables Fruit and Vegetable table. The Fruit table has a FruitID and a Name column and the Vegetable table has a VegetableID and Name column.

Create a list of fruits and vegetables that includes any potential duplicate values. Ensure that it is in alphabetical order so that the duplicates are next to each other!

Code should look like: SELECT Name FROM Fruit UNION ALL SELECT Name FROM Vegetable ORDER BY NAME ASC;

It's possible you did not include ORDER BY part, for most of these tasks site logic will look for exact match in your answer and sometimes error you get do not pinpoint your problem.