题解 | 更新用户积分信息?
with tmp as ( select t.user_id,sum(t.order_price) as total from ( select user_id,order_price from order_tb where order_price > 100) as t group by t.user_id) select t1.user_id,(t1.total + t2.point) as point from tmp as t1 left join uservip_tb as t2 on t1.user_id = t2.user_id order by point desc;