The Set Operators Are 4 Types Which Are: 1) Union 2) Union All 3) Intersect 4) Minus
The Set Operators Are 4 Types Which Are: 1) Union 2) Union All 3) Intersect 4) Minus
Def: use a set operators to combine multiple queries into a single query.
The Set Operators are 4 types which are
1)
2)
3)
4)
Union
Union all
Intersect
Minus
1) Union:
Def: The union operator returns only distinct rows from both queries and remove
duplicates.
Example:
Select select deptno from emp
union
select deptno from dept;
2) Union all:
Def: The Union all operator returns all rows from both queries including all
duplicates.
Example:
select deptno from emp
union all
select deptno from dept
3) Intersect:
Def: The Intersect operator returns that are common to both queries.
Example:
select deptno from emp
intersect
4) Minus:
Def: The minus operator returns "results from the 1st query which are not
contained by the second query.
Example:
select deptno from dept
minus
select deptno from emp