zoukankan      html  css  js  c++  java
  • 清除在已在销售中消化,使用校验后又重新插入的数据(宝丰财务)

    --清除在已在销售中消化,使用校验后又重新插入的数据
    drop table pcje2007
    select lsh,pcrq,xmbm,ph,sqys,sqyje,bqss,bqsje,bqfs,bqfje,jcs,pcs,sqyje+bqsje-bqfje+(dslsj*(pcs-jcs)) as pcje,round(PCS*DSLSJ,2) AS PCJE2 into pcje2007  from zy_yp1_pcb where datediff(mm,pcrq,'2007-01-01')=0
    delete from pcje2007 where sqys=0 and bqss=0 and bqfs=0 and jcs=0 and pcs=0

    select a.pcrq,b.pcrq,a.xmbm,a.ph,a.sqyje,b.pcje,B.PCJE2 from zy_yp1_pcb a,pcje2007 b where datediff(mm,a.pcrq,'2007-2-01')=0 and a.xmbm=b.xmbm and a.ph=b.ph and ABS(a.sqyje-b.pcje2)>0

    select * into pcb200701 from zy_yp1_pcb
    update zy_yp1_pcb set sqyje=B.PCJE2 from zy_yp1_pcb a,pcje2007 b where datediff(mm,a.pcrq,'2007-1-01')=0 and a.xmbm=b.xmbm and a.ph=b.ph and ABS(a.sqyje-b.pcje2)>0
    SELECT * FROM ZY_SYS2_YPZDK WHERE GBM='11097570'


    update zy_yp1_pcb set dslsj=round((sqyje+bqsje)/((case (sqys+bqss) when 0 then 1 else sqys+bqss end)),4) from zy_yp1_pcb where abs((sqyje+bqsje)/((case (sqys+bqss) when 0 then 1 else sqys+bqss end))-dslsj)>1 and  datediff(mm,pcrq,'2007-2-01')=0 and round((sqyje+bqsje)/((case (sqys+bqss) when 0 then 1 else sqys+bqss end)),4)<>0
    select xmbm,dslsj,round((sqyje+bqsje)/((case (sqys+bqss) when 0 then 1 else sqys+bqss end)),4) from zy_yp1_pcb where abs((sqyje+bqsje)/((case (sqys+bqss) when 0 then 1 else sqys+bqss end))-dslsj)>1 and  datediff(mm,pcrq,'2007-2-01')=0 and round((sqyje+bqsje)/((case (sqys+bqss) when 0 then 1 else sqys+bqss end)),4)<>0


     

  • 相关阅读:
    Ubuntu下Anaconda3的安装
    在Ubuntu上安装微信
    HTTP Response Code 中文详解
    urllib.parse.urldefrag(url)的解释
    极大似然估计
    多序列比对后可视化之texshade
    Musle比对软件(windows)
    windows本地blast
    绘制pathway富集散点图
    计算相关性系数
  • 原文地址:https://www.cnblogs.com/hhq80/p/661104.html
Copyright © 2011-2022 走看看