I say.

A blog by Joakim Beijar, I solve interesting and mundane problems at HappySignals and hack at night on github.com/kaa.

TSQL's UNION operation really is a UNION

08 Mar 2011

This one caught me a bit off guard. It turns out UNION in TSQL really is the mathematical union of the two result sets not just the concatenation of the involved results.

Include the keyword ALL to ensure duplicates are also returned.


Incorporates all rows into the results. This includes duplicates. If not specified, duplicate rows are removed.

- Transact-SQL reference