欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  数据库

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

程序员文章站 2024-01-12 22:16:34
...
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