电脑桌面
添加蚂蚁七词文库到电脑桌面
安装后可以在桌面快捷访问

如何批量修复额度周期重复的数据

来源:金蝶云社区作者:金蝶2024-09-226

如何批量修复额度周期重复的数据

[适用版本]

8.5sp1,8.6,8.6sp1

[解决方案]

问题:如何批量修复额度周期重复的数据

参考sql脚本:

--查出异常数据

select a.FPROPOSERID , a.fid,a.fcyclebegindate,a.fcycleenddate,a.FSTANDARDLIMIT ,a.FREALLIMIT ,a.FUSEDLIMIT ,a.FREEZELIMIT ,a.FREMAINLIMIT ,a.FCYCLETYPE

from t_hr_ats_holidaylimit a

inner join(

select FPROPOSERID ,FHOLIDAYPOLICYID,FCYCLEBEGINDATE ,FCYCLEENDDATE

from t_hr_ats_holidaylimit

where FCYCLEBEGINDATE >={ts '2020-01-01'}

group by fproposerid,FHOLIDAYPOLICYID ,FCYCLEBEGINDATE ,FCYCLEENDDATE

having count(1)>1

)b on a.fproposerid=b.fproposerid and a.fholidaypolicyid=b.fholidaypolicyid and a.fcyclebegindate =b.fcyclebegindate and a.fcycleenddate=b.fcycleenddate

order by FPROPOSERID

--备份数据

select * into holidaylimit1113 from t_hr_ats_holidaylimit

select * into holidaylimitdetail1114 from t_hr_ats_holidaylimitdetail


select a.fproposerid,b.fname_l2,b.fnumber

from holidaylimit1113 a

inner join t_bd_person b on a.fproposerid=b.fid

where a.fusedlimit=0 and a.fcyclebegindate>={ts '2020-01-01'}

group by a.FPROPOSERID ,a.FHOLIDAYPOLICYID,a.FCYCLEBEGINDATE ,a.FCYCLEENDDATE ,b.fname_l2,b.fnumber

having count(1)>1

9040691,2509,9020199,9040973,102463,103745,103864,9000319,9000064,3315

--修复数据

--删除已用和冻结均为0且周期重复的数据

delete from t_hr_ats_holidaylimt

where fid in(

select min(fid)

from t_hr_ats_holidaylimit

where fusedlimit=0 and FREEZELIMIT=0 and FCYCLEBEGINDATE >={ts '2020-01-01'}

group by fproposerid,FHOLIDAYPOLICYID

如何批量修复额度周期重复的数据

[适用版本]8.5sp1,8.6,8.6sp1[解决方案]问题:如何批量修复额度周期重复的数据参考sql脚本:--查出异常数据select a.FPROPOSERID , a.fid,...
点击下载文档文档为doc格式

声明:除非特别标注,否则均为本站原创文章,转载时请以链接形式注明文章出处。如若本站内容侵犯了原著者的合法权益,可联系本站删除。

已经是第一篇
确认删除?
回到顶部
客服QQ
  • 客服QQ点击这里给我发消息
QQ群
  • 答案:my7c点击这里加入QQ群
支持邮箱
微信
  • 微信