Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in SQL by (55.6k 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, 2021 in SQL by Appu (6.1k points)
0 votes
1 answer
0 votes
1 answer
asked May 4, 2023 in SQL by neelimakv (37.3k points)
0 votes
1 answer
asked Apr 2, 2021 in SQL by dev_sk2311 (45k points)
0 votes
1 answer

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...