批量删除请假重复扣减明细的参考脚本

栏目:s-hr cloud知识作者:金蝶来源:金蝶云社区发布:2024-09-22浏览:1

批量删除请假重复扣减明细的参考脚本

[适用版本]

通用

[解决方案]

--查询数据

select b.fnumber,b.fname_l2,c.fnumber,a.FProposerID,a.FLeaveBillID,a.FHolidaylimitid

from t_hr_ats_holidaylimitdetail a

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

inner join t_hr_AtS_leavebill c on a.FLEAVEBILLID =c.fid

where a.FCHANGETYPE =4

group by b.fnumber,b.fname_l2,c.fnumber,a.FProposerID,a.FLeaveBillID,a.FHolidaylimitid

having count(1)>1


--备份数据

select * into holidaylimitdetail0730 from t_hr_AtS_holidaylimitdetail

--修复数据

delete from t_hr_ats_holidaylimitdetail

where FLEAVEBILLID in(select fleavebillid from t_hr_ats_holidaylimitdetail where FCHANGETYPE =4 group by FProposerID,FLeaveBillID,FHolidaylimitid having count(1)>1

)

and fid not in(select min(fid) from t_hr_ats_holidaylimitdetail where FCHANGETYPE =4 group by FProposerID,FLeaveBillID,FHolidaylimitid having count(1)>1)

and FHOLIDAYLIMITID in(select FHOLIDAYLIMITID from t_hr_ats_holidaylimitdetail where FCHANGETYPE =4 group by FProposerID,FLeaveBillID,FHolidaylimitid having count(1)>1)


批量删除请假重复扣减明细的参考脚本

[适用版本]通用[解决方案]--查询数据select b.fnumber,b.fname_l2,c.fnumber,a.FProposerID,a.FLeaveBillID,a.FHolidaylimitid from t_h...
点击下载文档
确认删除?
回到顶部
客服QQ
  • 客服QQ点击这里给我发消息