Oracle intersection | intersect - oracle tutorial - sql tutorial

Learn oracle - oracle tutorial - Oracle intersection - oracle examples - oracle programs
What is Oracle INTERSECT ?
- The Oracle INTERSECT operator is used to return the results of 2 or more SELECT statements.
- However, it only returns the rows selected by all queries or data sets.
- If a record exists in one query and not in the other, it will be omitted from the INTERSECT results.

Syntax:
SELECT column_name
FROM Table1
INTERSECT
Select column_name
FROM Table_2;
click below button to copy the code. By - oracle tutorial - team
Example:
SELECT name
FROM wikitechy_employee4
INTERSECT
Select name
FROM wikitechy_employee5;
click below button to copy the code. By - oracle tutorial - team
Screenshot:
- For better understanding we are using the sample table called wikitechy_employee4

- Similarly, we are selecting another table with 3 columns in it.


- Using INTERSECT Statement, we are selecting the common field from the above table,
Oracle Union Vs UnionAll Vs Except Vs Intersect
