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

Can anyone explain intersect in SQL?

1 Answer

0 votes
by (119k 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 Jan 2 in SQL by Appu (6.1k points)
0 votes
1 answer
0 votes
1 answer
asked Apr 2 in SQL by dev_sk2311 (38.9k points)
0 votes
1 answer
asked Mar 23 in SQL by dev_sk2311 (38.9k points)
Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...