0 votes
1 view
in SQL by (35.7k points)

Can anyone explain intersect in SQL?

1 Answer

0 votes
by (86.2k points)

In SQL, the INTERSECT operator is used to returns the common rows of result sets of two SELECT statements. It has the same rules as  UNION operator that the result sets of both SELECT statements must have the same number of columns, similar data types of columns, and the order also should be same.

Here is the syntax for using INTERSECT operator in SQL:

SELECT column_list

FROM TableA

WHERE condition

 

INTERSECT

 

SELECT column_list

FROM TableB

WHERE condition;

You can check out this SQL Tutorial blog by Intellipaat to learn more about INTERSECT operator and other operators.

Related questions

0 votes
1 answer
asked Aug 16 in SQL by Sudhir_1997 (35.7k points)
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
asked May 8 in SQL by Sudhir_1997 (35.7k points)
0 votes
1 answer
asked May 7 in SQL by Sudhir_1997 (35.7k points)
Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...