34,594
社区成员
发帖
与我相关
我的任务
分享
select * from table1
where ID >1000
and not exists(select 1 from table2 where table1.ID=table2.id)
SELECT T1.*
FROM table1 T1
LEFT JOIN table2 T2 ON T1.id=T2.id AND .....--(table2表的条件,列名最好加前缀T2.)
WHERE T1.id>1000 AND T2.id IS NULL
试下,不知道会不会快点