常用mysql语句 查用户排名 select m.*,@r:=@r + 1 as rank from (SELECT @r:=0) r,userinfo as m order by m.id desc;