半年的月销售报表
月份 1月 2月 3月 4月 5月 6月
洗发水 单价 ¥36 ¥35 ¥33 ¥24 ¥30 ¥30
销售量 300 231 230 151 352 123
洗发水月销售额 ¥10,800 ¥8,085 ¥7,590 ¥3,624 ¥10,560 ¥3,690
沐浴露 单价 ¥28 ¥29 ¥35 ¥28 ¥29 ¥28
销售量 400 335 250 321 325 243
沐浴露月销售额 ¥11,200 ¥9,715 ¥8,750 ¥8,988 ¥9,425 ¥6,804
洗面奶 单价 ¥54 ¥46 ¥34 ¥50 ¥46 ¥56
销售量 350 204 340 250 345 198
洗面奶月销售额 ¥18,900 ¥9,384 ¥11,560 ¥12,500 ¥15,870 ¥11,088
香皂 单价 ¥8 ¥6 ¥5 ¥8 ¥6 ¥7
销售量 344 431 300 261 172 195
香皂月销售额 ¥2,580 ¥2,586 ¥1,500 ¥1,958 ¥1,032 ¥1,365
月销售总额 ¥43,480 ¥29,770 ¥29,400 ¥27,070 ¥36,887 ¥22,947 各个商品的月销售额是单价*销售量
月销售总额是当月个产品销售额的总和
月份 1月 2月 3月 4月 5月 6月
洗发水 单价 ¥36 ¥35 ¥33 ¥24 ¥30 ¥30
销售量 300 231 230 151 352 123
洗发水月销售额 ¥10,800 ¥8,085 ¥7,590 ¥3,624 ¥10,560 ¥3,690
沐浴露 单价 ¥28 ¥29 ¥35 ¥28 ¥29 ¥28
销售量 400 335 250 321 325 243
沐浴露月销售额 ¥11,200 ¥9,715 ¥8,750 ¥8,988 ¥9,425 ¥6,804
洗面奶 单价 ¥54 ¥46 ¥34 ¥50 ¥46 ¥56
销售量 350 204 340 250 345 198
洗面奶月销售额 ¥18,900 ¥9,384 ¥11,560 ¥12,500 ¥15,870 ¥11,088
香皂 单价 ¥8 ¥6 ¥5 ¥8 ¥6 ¥7
销售量 344 431 300 261 172 195
香皂月销售额 ¥2,580 ¥2,586 ¥1,500 ¥1,958 ¥1,032 ¥1,365
月销售总额 ¥43,480 ¥29,770 ¥29,400 ¥27,070 ¥36,887 ¥22,947 各个商品的月销售额是单价*销售量
月销售总额是当月个产品销售额的总和
产品信息表productinfo(proid,proname)
订单表orders(orid,empid,ordertime)
订单子表orderinfo(id,orid,proid,orsale,ornum)
http://topic.csdn.net/u/20091130/21/fb718680-98ff-4afb-98d8-cff2f8293ed5.html?24281
select 产品名称,'数量' as ctype,sum(case when month(销售日期)=1 then 销售数量 else 0 end) as m1,sum(case when month(销售日期)=2 then 销售数量 else 0 end) as m2,sum(case when month(销售日期)=3 then 销售数量 else 0 end) as m3,sum(case when month(销售日期)=4 then 销售数量 else 0 end) as m4 from 视图 group by 产品名称
union all
select 产品名称,'金额' as ctype,sum(case when month(销售日期)=1 then 销售金额 else 0 end) as m1,sum(case when month(销售日期)=2 then 销售金额 else 0 end) as m2,sum(case when month(销售日期)=3 then 销售金额 else 0 end) as m3,sum(case when month(销售日期)=4 then 销售金额 else 0 end) as m4 from 视图 group by 产品名称
order by 产品名称方法就这样的了。其它根据自己需要自己变一下就好。
select 产品名称,'数量' as ctype,sum(case when month(销售日期)=1 then 销售数量 else 0 end) as m1,sum(case when month(销售日期)=2 then 销售数量 else 0 end) as m2,sum(case when month(销售日期)=3 then 销售数量 else 0 end) as m3,sum(case when month(销售日期)=4 then 销售数量 else 0 end) as m4 from 视图 group by 产品名称
union all
select 产品名称,'金额' as ctype,sum(case when month(销售日期)=1 then 销售金额 else 0 end) as m1,sum(case when month(销售日期)=2 then 销售金额 else 0 end) as m2,sum(case when month(销售日期)=3 then 销售金额 else 0 end) as m3,sum(case when month(销售日期)=4 then 销售金额 else 0 end) as m4 from 视图 group by 产品名称
order by 产品名称方法就这样的了。其它根据自己需要自己变一下就好。
对我有用[0] 丢个板砖[0] 引用 举报 管理 TOP
管理菜单 生成帖子 置顶 推荐 取消推荐 锁定 解锁 移动 编辑 删除 帖子加分 帖子高亮 取消高亮
结 帖 发 帖 回 复
select 产品名称,'数量' as ctype,sum(case when month(销售日期)=1 then 销售数量 else 0 end) as m1,sum(case when month(销售日期)=2 then 销售数量 else 0 end) as m2,sum(case when month(销售日期)=3 then 销售数量 else 0 end) as m3,sum(case when month(销售日期)=4 then 销售数量 else 0 end) as m4 from 视图 group by 产品名称
union all
select 产品名称,'金额' as ctype,sum(case when month(销售日期)=1 then 销售金额 else 0 end) as m1,sum(case when month(销售日期)=2 then 销售金额 else 0 end) as m2,sum(case when month(销售日期)=3 then 销售金额 else 0 end) as m3,sum(case when month(销售日期)=4 then 销售金额 else 0 end) as m4 from 视图 group by 产品名称
order by 产品名称方法就这样的了。其它根据自己需要自己变一下就好。
对我有用[0] 丢个板砖[0] 引用 举报 管理 TOP
管理菜单 生成帖子 置顶 推荐 取消推荐 锁定 解锁 移动 编辑 删除 帖子加分 帖子高亮 取消高亮
结 帖 发 帖 回 复
select 产品名称,'数量' as ctype,sum(case when month(销售日期)=1 then 销售数量 else 0 end) as m1,sum(case when month(销售日期)=2 then 销售数量 else 0 end) as m2,sum(case when month(销售日期)=3 then 销售数量 else 0 end) as m3,sum(case when month(销售日期)=4 then 销售数量 else 0 end) as m4 from 视图 group by 产品名称
union all
select 产品名称,'金额' as ctype,sum(case when month(销售日期)=1 then 销售金额 else 0 end) as m1,sum(case when month(销售日期)=2 then 销售金额 else 0 end) as m2,sum(case when month(销售日期)=3 then 销售金额 else 0 end) as m3,sum(case when month(销售日期)=4 then 销售金额 else 0 end) as m4 from 视图 group by 产品名称
order by 产品名称方法就这样的了。其它根据自己需要自己变一下就好。
对我有用[0] 丢个板砖[0] 引用 举报 管理 TOP
管理菜单 生成帖子 置顶 推荐 取消推荐 锁定 解锁 移动 编辑 删除 帖子加分 帖子高亮 取消高亮
结 帖 发 帖 回 复