题解 | 统计各等级会员用户下订单总额
with tmp as ( select t1.*,t2.vip,t2.point from order_tb as t1 right join uservip_tb as t2 on t1.user_id = t2.user_id) select vip ,sum(case when order_price != 'null' then order_price else 0 end) as order_total from tmp group by vip order by order_total desc;