Foxtable(狐表)用户栏目专家坐堂 → 进销存思路


  共有4309人关注过本帖树形打印复制链接

主题:进销存思路

帅哥哟,离线,有人找我吗?
Bin
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:贵宾 帖子:35433 积分:178524 威望:0 精华:3 注册:2013/3/30 16:36:00
  发帖心情 Post By:2014/7/5 10:43:00 [显示全部帖子]

这样?
 下载信息  [文件大小:   下载次数: ]
图片点击可在新窗口打开查看点击浏览该文件:进销存.table


查询所有款号情况
select * from (select 销售商场,a.款号,销售类型,件数,成交价,入库商场,入库件数 from(select 销售商场,款号,销售类型,sum(件数) as 件数,sum(成交价) as 成交价 from {销售表} group by 销售商场,款号,销售类型) a left join (select 款号,入库商场,sum(件数) as 入库件数 from {入库表} group by 款号,入库商场) b on a.款号=b.款号 and a.销售商场=b.入库商场) c  left join (select 款号,出库商场,sum(出库件数) as 出库件数 from {出库表} group by 款号,出库商场) d on c.款号=d.款号 and c.销售商场=d.出库商场


指定款号

select * from (select 销售商场,a.款号,销售类型,件数,成交价,入库商场,入库件数 from(select 销售商场,款号,销售类型,sum(件数) as 件数,sum(成交价) as 成交价 from {销售表} group by 销售商场,款号,销售类型) a left join (select 款号,入库商场,sum(件数) as 入库件数 from {入库表} group by 款号,入库商场) b on a.款号=b.款号 and a.销售商场=b.入库商场) c  left join (select 款号,出库商场,sum(出库件数) as 出库件数 from {出库表} group by 款号,出库商场) d on c.款号=d.款号 and c.销售商场=d.出库商场 where c.款号='G2162JE23'

 回到顶部