Set Operations

Page comment added by Steven Hawkins


> The line about UNION/INTERSECT/EXCEPT with ALL seems a little redundant because the preceding line already explains how the output columns need to match, and the following line says that INTERSECT/EXCEPT with ALL is not supported.

Comparable types is referring to types that support comparison (and the by order/distinct processing), which is a different consideration than the types between branches being convertible.

> Is there a reason that INTERSECT ALL and EXCEPT ALL are not supported?

It is somewhat common to not support the all option with INTERSECT/EXCEPT. In the non-all case we can use efficient semi and anti semi join processing. In the all case things are not as straight-forward since we have to retain cardinality - that is if the first set contains 5 of the same entry and the other contains 3, then except all would return 2.

In reply to a comment by Tom Arnold:

The line about UNION/INTERSECT/EXCEPT with ALL seems a little redundant because the preceding line already explains how the output columns need to match, and the following line says that INTERSECT/EXCEPT with ALL is not supported.

Is there a reason that INTERSECT ALL and EXCEPT ALL are not supported? It seems like it would be simpler to ignore duplicates than to remove them.

Stop watching space | Change email notification preferences
View Online | Reply To This