Combines the result set of two or more SELECT statements
Contain only distinct values
Will sort the first col automatically
UNION ALL
Combines the result set of two or more SELECT statements
Will includes duplicate values
Can be used in recursive CTE
SELECTcol_nameFROMtable1_nameUNIONSELECTcol_nameFROMtable2_name;-- combines the result set of two or more SELECT statements (only distinct values)
-- must have the same number and same type of cols in the result sets
SELECTcol_nameFROMtable1_nameUNIONALLSELECTcol_nameFROMtable2_name;-- combines the result set of two or more SELECT statements (includes duplicates)
-- must have the same number and same type of cols in the result sets
SELECTcol_nameFROMtable1_nameINTERSECTSELECTcol_nameFROMtable2_name;-- only distinct values
SELECTcol_nameFROMtable1_nameEXCEPTSELECTcol_nameFROMtable2_name;-- only distinct values