常用mysql语句

查用户排名

select  m.*,@r:=@r + 1 as rank from (SELECT @r:=0) r,userinfo as m order by m.id desc;

 

posted @ 2016-05-26 09:17  刘贝  阅读(119)  评论(0编辑  收藏  举报