Here is a list of DB2 SQL Set operators that allow you to combine one are more queries.
6 set operators in db2
- 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.
Keep Reading
Subscribe






