update A set A.IS_TRUE=1 where A.IDENTITY_ID not in (SELECT A.IDENTITY_ID from A minus SELECT B.IDENTITY_ID from B);commit;数据量>100W,可考虑用小批次进行更新。
;with aaa as( select a.id from tableA a inner join tableB b on a.id=b.id and a.num=b.num) update a set a.num='true' from tableA a inner join aaa b on a.id=b.id
select A.ID, B.ID AS ID from A CROSS JOIN B
where A.ID=B.ID
查询出交集存入 然后根据ID update
select a.id from tableA a inner join tableB b on a.id=b.id and a.num=b.num)
update a set a.num='true' from tableA a inner join aaa b on a.id=b.id