SQL 替换not in

原句:

select * from aa where id not in(select id from bb)

替换:

select cc.id,cc.value from (select aa.*,bb.id as tempcolum from aa left join bb on aa.id=bb.id) as cc where cc.tempcolum is null

posted @ 2012-07-16 09:44  RyanRuan  阅读(207)  评论(0编辑  收藏  举报
View Code