MS Access - 针对嵌套用户输入进行选择?

时间:2016-09-06 16:52:50

标签: sql ms-access

是否可以从具有用户输入的另一个选择查询的结果中选择Access中的表?

这是我的初步查询:

SELECT List FROM [Material and Finishes] WHERE Materials = [Material:];

我正试图将它放入此查询中:

SELECT SubstanceName FROM [Core] WHERE Product Like '*Plastic*' 

我正在尝试将它们组合在一起:

SELECT SubstanceName
FROM [Core] 
WHERE ProductAreas > ANY 
( SELECT List FROM [Material and Finishes] WHERE Materials = [Material:]) 

但是我只在子查询“列表”中获得了无效的备注,OLE或超链接对象。

有什么想法吗?

1 个答案:

答案 0 :(得分:1)

这样做你想要的吗?

SELECT c.SubstanceName
FROM [Core] as c
WHERE EXISTS (SELECT 1
              FROM [Material and Finishes] as mf
              WHERE mf.Materials = [Material:] AND
                    mf.Product Like '*' & c.ProductAreas & '*'
             ) ;