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

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

WBOY
Release: 2016-06-01 13:19:00
Original
880 people have browsed it

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
Copy after login
bitsCN.com
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template