如何解决客户F7出现重复客户的问题原创
6人赞赏了该文章
206次浏览
编辑于2023年07月11日 15:04:35
如何解决客户F7出现重复客户的问题
某些业务客户F7会出现有重复的数据(如上图),这个是数据库脏数据导致的,根据以下脚本按顺序执行可以清理掉重复数据:
--1.查看重复 select FCUSTOMERGROUPSTANDARDID ,FCUSTOMERGROUPID,FCUSTOMERID,count(1) from T_BD_customerGroupDetail group by FCUSTOMERGROUPSTANDARDID ,FCUSTOMERGROUPID,FCUSTOMERID having count(1)>1; --2.备份 select * into bak190821_customerGroupDetail from T_BD_customerGroupDetail; --3.删除重复 delete from T_BD_customerGroupDetail where fid not in (select max(FID) from T_BD_customerGroupDetail group by FCUSTOMERGROUPSTANDARDID ,FCUSTOMERGROUPID,FCUSTOMERID );
请务必在测试数据库测试运行,再到正式库执行!
推荐阅读