Intersect

From Oracle FAQ
Jump to: navigation, search

INTERSECT is a SQL set operation that selects common elements from two different select statements.

For example, the below query will only return rows that are in both table_A and table_B:

SELECT * FROM table_A
INTERSECT
SELECT * FROM table_B;

Also see[edit]

  • Minus - return rows that's in table A, but not in table B
  • Union - combine rows from tables and remove duplicates
  • Union all - combine rows from tables, but don't remove duplicates
Glossary of Terms
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z #