DB2- SET Operators

DB2+JCL JobsSet operators allow you to combine one are more queries.

EXCEPT -All duplicate rows found in each result data set produced are eliminated from the result data set of the first query and this modified result data set is returned.
EXCEPT ALL – All rows found in the first result data set produced that do not have a matching row in the second result data set are returned.
INTERSECT – The result data sets produced by each individual query are compared, and every record that is found in both result data sets is copied to a new result data set, all duplicate rows in this new result data set are eliminated, and the new result data set is returned.
INTERSECT ALL – The result data sets produced by each individual query are compared and each record that is found in both result data sets is copied to a new result data set; all duplicate rows found in this new result data set are retained.
UNION – The result data sets produced by each individual query are combined and all duplicate rows are eliminated.
UNION ALL – The result data sets produced by each individual query are combined and any duplicate rows found are retained.

Advertisements

Author: Srini

Experienced software developer. Skills in Development, Coding, Testing and Debugging. Good Data analytic skills (Data Warehousing and BI). Also skills in Mainframe.