Chapter 6. Set Operators

Set operators are operators that are applied between two input sets—or, to use the more accurate SQL term, multisets—that result from two input queries. Remember, a multiset is not a true set, because it can contain duplicates. When I use the term multiset in this chapter, I’m referring to the intermediate results from two input queries that might contain duplicates. Although there are two multisets as inputs to an operator, depending on the flavor of the operator, the result is either a set or a multiset. If the operator is a true set operator (a DISTINCT flavor), the result is a set with no duplicates. If the operator is a multiset operator (an ALL flavor), the result is a multiset with possible duplicates. This chapter ...

Get Microsoft® SQL Server® 2012 T-SQL Fundamentals now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.