A关联B怎么查出A表里面的数据在B表没有的数据

    技术2022-07-11  141

    SQL语句如何A关联B怎么查出A表里面的数据在B表没有的数据

    mysql写法oracle写法

    mysql写法

    select * from content a where a.contentID not in (select b.contentID from contentsku b )

    oracle写法

    select * from content a where a.contentID not in (select b.contentID from contentsku b where b.contentID is not null )

    Oracle 要加这个where b.contentID is not null

    Processed: 0.012, SQL: 9