mysql排行榜並列與不併列

分數表:   一、普通並列排行 SELECT *, ( SELECT count(DISTINCT score) FROM scores AS b WHERE a.score < b.score ) + 1 AS rank FROM scores AS a ORDER BY `rank`   二、高級並列排行 SELECT id, score, rank
相關文章
相關標籤/搜索