去除数据库的重复数据

UPDATE ptop_investrecord set delflag = 1 where id in (SELECT o.id from (SELECT uid,min(id) as id,count(uid) as num 
from ptop_investrecord 
where cid = 1578  and progress = 1  and comefrom = '5' AND delflag = 0 GROUP BY uid,flagname,money HAVING num >1) as o);

只对老的数据进行更改

posted @   matengfei  阅读(162)  评论(0编辑  收藏  举报
努力加载评论中...
点击右上角即可分享
微信分享提示