合并数据库重复记录处理
1.update mem_localmemberbaseinfo set balance=(
select b from (select count(uniqueid) as a,sum(balance) as b
group by uniqueid having count(uniqueid)>1) x) where uniqueid=
(select d from (select count(uniqueid) as c,uniqueid as d group by uniqueid having count(uniqueid)>1) x) and id>100000;
select b from (select count(uniqueid) as a,sum(balance) as b
group by uniqueid having count(uniqueid)>1) x) where uniqueid=
(select d from (select count(uniqueid) as c,uniqueid as d group by uniqueid having count(uniqueid)>1) x) and id>100000;
2.delete from mem_localmemberbaseinfo where uniqueid=(select d from (select count(uniqueid) as c,uniqueid as d group by uniqueid having count(uniqueid)>1) x) and id<100000;
浙公网安备 33010602011771号