问题解决方式: |
脚本模板如下:先做好备份数据,然后从表bm_bmclass中找到对应的福利类别主键,再从bm_item中找到对应的福利项目。
create table bm_psndata_0818 as select * from bm_psndata;
--查询出系统预置的基金基数fbmbase=0的人员
select * from bm_psndata where bmclassid = 福利类别 and cfundmonth = 月份 and cfundyear = 年度 and pk_psnbasdoc in (
select pk_psnbasdoc from bm_data where bmclassid = 福利类别 and cfundmonth = 月份 and cfundyear = 年度 and 福利项目fbmbase = 0);
--删除出系统预置的基金基数fbmbase=0的人员
delete from bm_psndata where bmclassid = 福利类别 and cfundmonth = 月份 and cfundyear = 年度 and pk_psnbasdoc in (
select pk_psnbasdoc from bm_data where bmclassid = 福利类别 and cfundmonth = 月份 and cfundyear = 年度 and 福利项目fbmbase = 0); |