whats the difference between and and intersect in sql code example

Example 1: what is intersect in sql

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.

Example 2: minus vs intersect in sql

MINUS (returns records from 1 query that are not present in 2 query)INTERSECT (returns only common for both queries data)

Tags:

Sql Example