|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
hangglide05-11-2005, 02:39 PM
Sorry if this has already been answered. I searched and couldn't find it.
How do I do an INTERSECT query in Access? It is my understanding that Access does not support the INTERSECT query. Is this right?
The syntax for an INTERSECT query is:
select field1, field2, … field_n
from tables
INTERSECT
select field1, field2, … field_n
from tables;
Example #1
The following is an example of an INTERSECT query:
select supplier_id
from suppliers
INTERSECT
select supplier_id
from orders;
The INTERSECT query allows you to return 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.
Is there a simple way to do that in Access? The only work around I know is to run the two select queries seperate and then run a third to see what they have in common. There has to be a simpler method (I want to code the solution in VBA script for an application I am writing).
Leo |
|