一、用法和解释
select * from inaj_b
where inaj_b.inaj035 = 'aint302'
and inaj_b.inaj022 = to_date('20171231', 'YYMMDD')
and not exists
(select 1 from inaj_t
where inaj_b.inaj001 = inaj_t.inaj001
and inaj_b.inaj002 = inaj_t.inaj002
and inaj_b.inaj003 = inaj_t.inaj003)
上述语句中not exists 后面的select 1 from 查找出inaj_t和inaj_b的数据交集的数据。整个语句的意思就是数据存在inaj_t,不存在inaj_b中。
网友评论