SQL “select where not in subquery” returns no results

后端 未结 11 2010
滥情空心
滥情空心 2020-11-29 14:46

Disclaimer: I have figured out the problem (I think), but I wanted to add this issue to Stack Overflow since I couldn\'t (easily) find it anywhere. Also, someone might

11条回答
  •  忘掉有多难
    2020-11-29 15:29

    select *
    from Common c
    where not exists (select t1.commonid from table1 t1 where t1.commonid = c.commonid)
    and not exists (select t2.commonid from table2 t2 where t2.commonid = c.commonid)
    

提交回复
热议问题