题解 | 统计各等级会员用户下订单总额
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
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
相关推荐