It is possible to perform set operations between queries, such as:

  • Query1 UNION Query2: appends the results of Query2 to the end of the table returned by Query1.
  • Query1 INTERSECT Query2: includes only the rows common to both Query1 and Query2 in the resulting table.
  • Query1 EXCEPT Query2: includes only the rows from Query1 that are not present in Query2 in the resulting table.

tags:#databases#programming-languages/SQL