Skip to content

Latest commit

 

History

History
32 lines (30 loc) · 807 Bytes

2017-01-23#实时销量查询.md

File metadata and controls

32 lines (30 loc) · 807 Bytes

实时销量查询

select
-- 商品数
sum(a.sg_goods_nums) goods_nums,
-- 商品金额
sum(a.sg_real_price) goods_amount,
-- 优惠金额
sum(a.sg_goods_fav) goods_fav,
-- 满减金额
sum(a.sg_reduce_price) goods_reduce_price,
-- 快递金额
sum(a.sg_goods_shipping_fav) goods_shipping_fav
from mysql.js_xiudang_js_order_user_js_uorder_info b
join mysql.js_xiudang_js_order_user_js_uorder_goods a on a.sg_order_no = b.soi_no
where b.soi_create_time >= '2017-01-23'
and b.soi_create_time < date_add('2017-01-23',1)
and (b.soi_type<>1 and b.soi_type <>7 and b.soi_type<>4 or b.soi_type is null);

流量查询

select
a.date,
sum(a.goods_amount)
from dw.fct_ordr_path_real a
where a.date='2017-01-23'
-- and a.entrance.page_id in (254)
group by
a.date;