Sql 不存在的MS Access查询

Sql 不存在的MS Access查询,sql,ms-access,Sql,Ms Access,我一直在四处寻找,但没能解决这个问题 我有两个由两个查询生成的表 SELECT [Account Combination].[Account Number] & [Account Combination].[Cost Center] & [Account Combination].Amount as Val1 FROM [Account Combination]; 及 表1有1800行,表2有1600行。我想看看表1和表2中的200 我尝试了Table1 NOT EXISTS

我一直在四处寻找,但没能解决这个问题

我有两个由两个查询生成的表

SELECT [Account Combination].[Account Number] & [Account Combination].[Cost Center] & [Account Combination].Amount as Val1 FROM [Account Combination];

表1有1800行,表2有1600行。我想看看表1和表2中的200

我尝试了Table1 NOT EXISTS Tabel2,但由于一直出现语法错误,无法使其正常工作

谢谢你抽出时间,
Simon。

您可以使用
左外连接
以及下面的
WHERE
条件来完成此操作

select t1.*
from (SELECT [Account Combination].[Account Number] & [Account Combination].[Cost Center] & [Account Combination].Amount as Val1 
FROM [Account Combination]) t1
left join (
SELECT [Account Combination].[Account Number] & [Account Combination].[Cost Center] & [Account Combination].Amount AS Val1 
FROM [Account Information] INNER JOIN ([Cost Center] INNER JOIN [Account Combination] 
ON [Cost Center].[Cost Center Number] = [Account Combination].[Cost Center]) 
ON [Account Information].[Account Number] = [Account Combination].[Account Number]) t2 
on t1.Val1 = t2.Val1 
where t2.Val1 is null;

您可以使用
左外连接
以及下面的
WHERE
条件来完成此操作

select t1.*
from (SELECT [Account Combination].[Account Number] & [Account Combination].[Cost Center] & [Account Combination].Amount as Val1 
FROM [Account Combination]) t1
left join (
SELECT [Account Combination].[Account Number] & [Account Combination].[Cost Center] & [Account Combination].Amount AS Val1 
FROM [Account Information] INNER JOIN ([Cost Center] INNER JOIN [Account Combination] 
ON [Cost Center].[Cost Center Number] = [Account Combination].[Cost Center]) 
ON [Account Information].[Account Number] = [Account Combination].[Account Number]) t2 
on t1.Val1 = t2.Val1 
where t2.Val1 is null;
看看:

它回答了如何使用不存在的问题。 顺便说一句,我注意到IS NULL子句更快。

看看:

它回答了如何使用不存在的问题。
顺便说一句,我注意到IS NULL子句更快。

正确标记问题以快速获得正确答案正确标记问题以快速获得正确答案