There is no way to compare as each has a different function. The Distinct keyord will eliminate duplicates in a result set when used in a Select query. The Union operator combines multiple row sets (multiple select queries) into one result set.
By default, Union does eliminate duplicates in the final result. Perhaps this is a source of confusion. For simple selects where distinct (non-duplicated) results are desired use the Distinct keyword. When combining result sets into one use the Union operator. Duplicates wil be elimnated unless the ALL keyword is used with the UNION operator. Terry L. Broadbent - DBA
Computing Links:
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.