How to find rows in one table that have no corresponding row in another table

后端 未结 6 741
甜味超标
甜味超标 2020-11-29 01:50

I have a 1:1 relationship between two tables. I want to find all the rows in table A that don\'t have a corresponding row in table B. I use this query:

SELEC         


        
6条回答
  •  一整个雨季
    2020-11-29 02:13

    select parentTable.id from parentTable
    left outer join childTable on (parentTable.id = childTable.parentTableID) 
    where childTable.id is null
    

提交回复
热议问题