两张表做笛卡尔积, 利用笛卡儿积的方法进行去重 。逻辑删除update,或直接删除delete
update eepm_engineer_pro_implement set state=2 where id in (
select p1.id
FROM eepm_engineer_pro_implement p1,eepm_engineer_pro_implement p2
WHERE
p1.guid = p2.guid AND p1.id > p2.id
and p1.histortydate like '2020-03-06%' and p1.state =1
and p2.histortydate like '2020-03-06%' and p2.state =1
);
来源:oschina
链接:https://my.oschina.net/suncici1101/blog/3190804