[大厂真题]SQL 18题解 | 更新用户积分信息?



SELECT t.user_id,t.price+b.point as `point`
from (
        SELECT a.user_id,sum(a.order_price) as price
        FROM order_tb a
        where a.order_price>100
        group by a.user_id
) t
inner join uservip_tb b 
on t.user_id=b.user_id
order by `point` desc

全部评论

相关推荐

评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客企业服务