2014-10-15 2 views
1

MS Access에서 SQL 쿼리를 수행해야합니다.MS Access 데이터베이스에서 SQL 쿼리 오류가 발생했습니다.

하지만 MS Access에서 오류가 발생했습니다 :

SELECT * 
FROM 
(
    SELECT * 
    FROM table1 
    where not exists 
    (
    SELECT * 
    FROM table2 
    where table2.id = table1.id 
    ) as t 
) as t1, table3 
where table3.id = t1.id 

구문 오류 :

어떤 도움 't으로하지 존재 (...)'쿼리 식 (누락 된 연산자)를 감상 할 수있다.

답변

2

존재하지 않는 subselect에는 별명이 필요하지 않습니다. 나는 당신은 또한 inner joinleft join 사용을 고려할 수있는 as t

SELECT * 
FROM 
(
    SELECT * 
    FROM table1 
    where not exists 
    (
    SELECT * 
    FROM table2 
    where table2.id = table1.id 
    ) 
) as t1, table3 
where table3.id = t1.id 

을 제거하는 제거했습니다 참고하여 not exists :

이 위의 정확히 동일해야 :

SELECT t1.*, t3.* 
FROM 
    table1 t1 
    inner join table3 t3 on t1.id = t3.id 
    left join table2 t2 on t1.id = t2.id 
where 
    t2.id is null