0% found this document useful (0 votes)
44 views

The Set Operators Are 4 Types Which Are: 1) Union 2) Union All 3) Intersect 4) Minus

Set operators allow combining multiple queries into a single query and include union, union all, intersect, and minus. Union returns distinct rows from queries and removes duplicates, while union all returns all rows including duplicates. Intersect returns rows common to both queries, and minus returns results from the first query that are not in the second query. The document provides definitions and examples of each set operator type.

Uploaded by

Srinivas Neelam
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
44 views

The Set Operators Are 4 Types Which Are: 1) Union 2) Union All 3) Intersect 4) Minus

Set operators allow combining multiple queries into a single query and include union, union all, intersect, and minus. Union returns distinct rows from queries and removes duplicates, while union all returns all rows including duplicates. Intersect returns rows common to both queries, and minus returns results from the first query that are not in the second query. The document provides definitions and examples of each set operator type.

Uploaded by

Srinivas Neelam
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Set Operators

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

select deptno from dept

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

You might also like