Databases Querying Relational Databases Set Operations Set Operations

Robert Edwardes
Robert Edwardes
15,777 Points

Using union all and not getting correct result

I am using Union all with the same number of columns and it is saying that it is not selecting all including duplicates

1 Answer

KRIS NIKOLAISEN
KRIS NIKOLAISEN
54,333 Points

You are right in using UNION ALL. The following selects all including duplicates:

SELECT Name FROM Fruit UNION ALL SELECT Name FROM Vegetable ORDER BY Name