Question d’entretien chez Providence

What does a Union do in SQL?

Réponse à la question d'entretien

Utilisateur anonyme

5 sept. 2015

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.