2010-03-17 3 views

답변

2

난 당신이 그런 걸 할 생각 :

select * from forum_topics t left outer join forum_posts p 
on t.id = p.topic_id 
where p.id is null; 
: 빠른 서브 쿼리보다 약간이 될 수 있습니다, 외부 조인을 사용하지만

select * from forum_topics t 
where not exists (
    select * from topics_posts p 
    where p.topic_id = t.id 
); 

+0

대단히 감사합니다. (외부 조인) –

관련 문제