2016-04-27 19 views
0

私は周りを見回しており、この作業を行うことができませんでした。MSアクセスクエリ存在しないWHERE NOT EXISTS

私は2つのクエリ

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

からの二つのテーブルの結果を持って

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]; 

表1は、1800行を持っており、表2は、私は表1に見つかり、中には見ら​​れないされて読みたい1600を持っていますテーブル2、the 200.

私はテーブル1 NOT EXISTSテーブル2を試みましたが、私はいつも構文エラーを取得するように正しく動作させることができませんでした。

ありがとうございました。 Simon。

+0

を成し遂げるには、以下のようWHERE条件と一緒にLEFT OUTER JOINを使用することができます – Rahul

答えて

4

あなたはすぐに正しい答えを得るために、適切にあなたの質問をタグこれは

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; 
関連する問題