mysql 联合查询后update

SELECT a.user_name,a.avatar,a.nicheng,a.user_rank,b.rank_name,b.rank_img FROM ecs_users a , ecs_user_rank b
WHERE user_id in(14495) and a.rank_points >= b.min_points and a.rank_points <= b.max_points ;


update ecs_users a,ecs_user_rank b
set a.user_rank =b.rank_id
WHERE user_id in(14495) and a.rank_points >= b.min_points and a.rank_points <= b.max_points ;

posted @ 2016-08-06 10:04  咸鱼公子  Views(3080)  Comments(0Edit  收藏  举报