zoukankan      html  css  js  c++  java
  • U8 存货期初余额 货位

    1、InvpositionSum:存货货位存量表

    2、invPosition:存货货位记录表

    3、期初:select a.cwhcode,b.cinvcode,b.iquantity,isnull(b.cfree1,'测试') cfree1,isnull(b.cfree2,'测试') cfree2,isnull(b.cfree3,'测试') cfree3,b.cposition from rdrecord34 a left join rdrecords34 b on a.id=b.id

    1是2的group合计

    2和3一一对应

    期初出错删除顺序:

    delete from Rdrecords34 where id in (select id from Rdrecord34 where cwhcode ='214')

    delete from Rdrecord34 where cwhcode ='214'

    delete from invPosition where cwhcode ='214'

    delete from InvpositionSum where cwhcode ='214'

    修改自由项

    update InvpositionSum set cfree1=UFDATA_006_2018..qichukucun.cfree1 from UFDATA_006_2018..qichukucun

    where InvpositionSum.autoid=UFDATA_006_2018..qichukucun.autoid

    select * from (select a.cwhcode,b.cinvcode,b.iquantity,isnull(b.cfree1,'测试') cfree1,isnull(b.cfree2,'测试') cfree2,isnull(b.cfree3,'测试') cfree3,b.cposition from rdrecord34 a left join rdrecords34 b on a.id=b.id ) c left join

    (select cwhcode,cinvcode,iquantity,(case cfree1 when '' then '测试' else cfree1 end) cfree1,(case cfree2 when '' then '测试' else cfree2 end) cfree2,(case cfree3 when '' then '测试' else cfree3 end) cfree3,cposcode from InvpositionSum ) d on

    c.cwhcode=d.cwhcode and c.cinvcode=d.cinvcode and c.cposition=d.cposcode and c.cfree1=d.cfree1 and c.cfree2=d.cfree2 and c.cfree3=d.cfree3

  • 相关阅读:
    MongoDB知识
    SELECT INTO 和 INSERT INTO SELECT 两种表复制语句
    SQL Server 触发器
    TSQL游标使用
    python和C#的区别
    bcp和SqlDataAdapter进行批量跟新插入方法
    SQL Server中索引视图用法详解
    hdu 1950 Bridging signals
    UVA 116 Unidirectional TSP
    poj 3230 Travel
  • 原文地址:https://www.cnblogs.com/passerlee/p/9999994.html
Copyright © 2011-2022 走看看