如果在表“b”的两个字段上未找到匹配项,我试图仅从表“a”中选择记录。我想出了以下内容,但它只是返回所有记录。代码看起来很简单,是 Access 没有正确处理 SELECT 1 函数还是我没有正确使用它?感谢您的任何帮助。
SELECT a.[Part Number],
a.[Company Name],
a.[Customer Name],
a.[Customer Number],
a.[Salesperson Initials],
a.[Date Received],
a.Quantity,
a.ExtCost,
a.ExtPrice,
a.[Gross Margin]
FROM [1: Orders in the period] As a
WHERE EXISTS (SELECT 1
FROM [Price Adjustments New Gross Margin] As b
WHERE b.[Part Number]<>a.[Part Number] AND b.[Customer Name]<>a.[Customer Name]);