Home >Database >Mysql Tutorial >MYSQL 排行类的相关SQL写法,仅供参考_MySQL

MYSQL 排行类的相关SQL写法,仅供参考_MySQL

WBOY
WBOYOriginal
2016-06-01 13:19:00878browse

bitsCN.com

SELECT * FROM    (SELECT pid, (@rowno:=@rowno+1) as rowno FROM user, (select (@rowno:=0)) b WHERE cid = 1  order by total_score DESC) as c WHERE pid = 1
bitsCN.com
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn