Providence Health & Services Interview Question: What does a Union do in SQL?... | Glassdoor

Interview Question

Data Analyst II Interview Portland, OR

What does a Union do in SQL?

Answer

Interview Answer

1 Answer

0

Allows you to append data from two sources (tables, views, SQL statements) into one table/view where records are not exactly the same. A union takes some time due to the fact both sources have to be evaluated between both sources to return one record. A union all is similar except the process of returning only a single record does not happen. You get a return of all records into one table/view for all records in a union all statement. One additional item of importance, is that both sources have to have exact fields and data types to return a final table/view.

Kevin on Sep 5, 2015

Add Answers or Comments

To comment on this, Sign In or Sign Up.