UNION :¶
The UNION command combines the result set of two or more SELECT statements (only distinct values)
1 2 3 | |
UNION ALL :¶
The UNION ALL command combines the result set of two or more SELECT statements (allows duplicate values).
1 2 3 | |
INTERSECT :¶
The SQL INTERSECT clause/operator is used to combine two SELECT statements, but returns rows only from the first SELECT statement that are identical to a row in the second SELECT statement. This means INTERSECT returns only common rows returned by the two SELECT statements.
1 2 3 | |
EXCEPET :¶
it always displays result in first select query which is not exist in second select query.
select empname,salary from emp
except
select empname,salary from emp2