Mysql 排名

SELECT id,name,num, @rownum := @rownum +1 AS ranking
FROM table t, (SELECT @rownum :=0) r where pid=15 order by num desc

 

posted @ 2016-03-11 16:54  Bin_x  阅读(93)  评论(0)    收藏  举报