--t_user 用户表 t_account 积分表 t_integral 等级表
--根据用户的积分、获取用户的等级,如果用户没有积分,则显示没有等级select t.id,t.username,ta.userId,(select (case when (ta.pointValue >integral_start && ta.pointValue< integral_end) then rank_name else null end ) gradea from t_integral order by gradea desc limit 0,1) gradefrom t_user t left outer join t_account ta on t.id=ta.userId where t.id='用户id';