关于导入凭证后再删除后未及时清理GL_CashTable 出现明细重复
如图:
---查询科目
select * from GL_CashTable where iyear=2023 and iYPeriod=202308 and ccode='100202' and iNo_id=2
select * from gl_accvouch where iyear=2023 and iperiod=8 and (ccode like '1001%' or ccode like '1002%')
--查询最大ID
select max(i_id),iSignSeq,iNo_id,inid,cCashItem,ccode from GL_CashTable where iyear=2023 and iYPeriod=202308
group by iPeriod,iSignSeq,iNo_id,inid,cCashItem,ccode
select * into gl_cashtable_20231017 from GL_CashTable where iyear=2023 and iYPeriod=202308 and ccode='100202' and iNo_id=2
select * from gl_accvouch where iyear=2023 and iperiod=8 and (ccode like '1001%' or ccode like '1002%')
select max(i_id),iSignSeq,iNo_id,inid,cCashItem,ccode from GL_CashTable where iyear=2023 and iYPeriod=202308 group by iPeriod,iSignSeq,iNo_id,inid,cCashItem,ccode
--清理非最大ID项
--delete from GL_CashTable where iyear=2023 and iYPeriod=202308 and i_id not in(select max(i_id) from GL_CashTable where iyear=2023 and iYPeriod=202308 group by iPeriod,iSignSeq,iNo_id,inid,cCashItem,ccode)
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 地球OL攻略 —— 某应届生求职总结
· 提示词工程——AI应用必不可少的技术
· 字符编码:从基础到乱码解决
· SpringCloud带你走进微服务的世界