题解 | 统计各等级会员用户下订单总额

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;

全部评论

相关推荐

2024-12-22 20:53
哈尔滨理工大学 C++
点赞 评论 收藏
分享
评论
1
收藏
分享

创作者周榜

更多
牛客网
牛客企业服务