Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

版本信息:9.85

问题原因:如何用快捷方法可以查到期初录入的库存商品数量与序列号数量不相符的商品?因为现在开账系统是逐条显示的,这样很慢。

处理方法:用下面语句去查询

SELECT i.PtypeId,i.Qty as 期初数量,b.XLH as 序列号个数,p.UserCode as 商品编码,p.FullName as 商品名称,s.FullName  as 仓库名称 from IniGoodsStocks i

left join (

select ptypeid,ktypeid,COUNT(*) XLH from gp_initPtypeSerial

group by ptypeid,ktypeid) b on i.PtypeId=b.PtypeID and i.KtypeId=b.KtypeID

left join ptype p on p.typeId=i.PtypeId

left join stock s on s.typeId=i.KtypeId

where i.Qty<>b.XLH