题解 | 统计各等级会员用户下订单总额
select u.vip,coalesce(sum(o.order_price),0) as order_total from uservip_tb u left join order_tb o on u.user_id = o.user_id group by u.vip order by order_total desc;
select u.vip,coalesce(sum(o.order_price),0) as order_total from uservip_tb u left join order_tb o on u.user_id = o.user_id group by u.vip order by order_total desc;
相关推荐