互联网电商大数据环境 ——大数飓数据分析实践培训精华笔记(九)——电商核心业务知识之订单商品模块

商品信息汇总表


select 
user_id, 
sum(case
when pay_type not in (‘退货’,’拒收’) then
     goods_amount
end)  p_sales_cnt,-排除退拒销售数量
sum(case
when pay_type not in (‘退货’,’拒收’) then
     goods_price * goods_amount
end)  p_sales_amt,-排除退拒销售金额
sum(case
when pay_type not in (‘退货’,’拒收’) then
     (goods_price – ‘优惠价’) * goods_amount
end)  p_sales_cnt_amt,-排除退拒销售金额(扣促销减免)
sum(goods_amount) h_sales_cnt, -含退拒销售数量
sum(goods_price * goods_amount) h_sales_amt, -含退拒销售金额
sum((goods_price – ‘优惠价’) * goods_amount) h_sales_cut_amt, -含退拒销售金额(扣促销减免)
sum(case
when pay_type in (‘退货’) then
     goods_amount
end) return_cnt,-退货商品数量
sum(case
when pay_type in (‘退货’) then
     goods_price * goods_amount
end) return_amt,-退货商品金额
sum(case
when pay_
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值