INTERSECT
The INTERSECT set operator is also used to combine two or more SELECT statements, but the resulting table only holds the rows which exist in all SELECT statements. In other words, it only returns the duplicate rows, but they are present only once in the final result.
Let’s see this operator in action by running the following query on our example tables:
TEXT/X-SQL
1SELECT * FROM Table1
2INTERSECT
3SELECT * FROM Table2;
The resulting table looks like this:

As we can see, the resulting table shows only the customers with IDs 2 and 3, which are the only two entries present in both tables.