商品未发货数量汇总.sql 261 B

123456
  1. SELECT t1.itemno,
  2. sum(t1.undeliqty) undeliqty
  3. FROM sa_orderitems t1
  4. inner join sa_order t3 on t1.siteid=t3.siteid and t1.sa_orderid=t3.sa_orderid
  5. WHERE t3.STATUS in ('审核')
  6. and t1.siteid=$siteid$ and t1.itemno in $itemnos$ group by t1.itemno