首页 > 其他 > 详细

库房分析数据

时间:2017-01-06 22:48:51      阅读:211      评论:0      收藏:0      [点我收藏+]

品种

select distinct spid from sphwph where hw in (‘HWI00000008‘,‘HWI00000003‘) and shl>0

批号

select distinct pihao,spid into #1 from sphwph where hw in (‘HWI00000008‘,‘HWI00000003‘) and shl>0 order by spid

select spid from #1 group by spid having count(spid)>1

select spid from #1 group by spid having count(spid)>2

select spid from #1 group by spid having count(spid)>3

select spid from #1 group by spid having count(spid)>4

合起来的小批号

select spid,pihao,sum(shl) shl into #2 from sphwph where hw in (‘HWI00000008‘,‘HWI00000003‘) and shl<>0 group by spid,pihao

select distinct pihao,spid from #2 where  shl>0 and shl<10  order by spid


散货品种有3146,批号共有4838,大于1的有1135,大于2的有372大于3的有124大于4的是37,小批号的1766


库房分析数据

原文:http://bks2015.blog.51cto.com/9847303/1889804

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!