有问题文章留言 看内容决定收费与免费
另外接收数据库质疑 勒索病毒数据恢复等项目。

商品库存查询异常

【问题描述】

某商品出入库明细中是正常显示,库存也是有结余的,在商品档案中显示库存为:0 库存查询中查不到库存。

【答】

请备份数据库后执行以下语句

–重算库存
use isszmv10
go
update t_im_branch_stock set stock_qty = aaa.qty
from
(select item_no,branch_no, sum(case db_no when ‘+’ then real_qty when ‘-‘ then -real_qty else 0 end)qty
from t_im_flow
group by item_no,branch_no) aaa
where t_im_branch_stock.item_no = aaa.item_no and t_im_branch_stock.branch_no = aaa.branch_no

赞(0)
未经允许不得转载:思迅软件知识库 » 商品库存查询异常
分享到: 更多 (0)

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址