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

select u.vip,ifnull(sum(order_price),0) 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;

!:left join和right join 的区别以及null-0

全部评论

相关推荐

瑞雪兆丰年_:可以贴个超级大的校徽,以防HR眼拙
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务