The SQL INTERSECT query returns the results of 2 or more
"select" queries. However, it only returns the rows selected by all
queries. If a record exists in one query and not in the other, it will
be omitted from the INTERSECT results.
The syntax for the SQL INTERSECT query is:
from table1
INTERSECT
select field1, field2, ..., field_n
from table2
select field1, field2, ..., field_n
from table1
where (field_x) IN (select field_x from table2);
Where field_x is the field over which the comparison is performed.
No comments:
Post a Comment