MySql 랭킹(순위) 추출 하기
//순위를 목록으로 조회 할때SELECT wr_id, wr_subject, as_star_score, rankingFROM ( SELECT t.wr_id, t.wr_subject, t.as_star_score, @rownum := @rownum + 1 AS ranking FROM 테이블 t JOIN (SELECT @rownum := 0) r ORDER BY t.as_star_score DESC) a //특정 row의 순위를 알아 낼때 (받은 점수를 기준으로..) SELECT t.wr_id, t.wr_subject, t.as_star_score, (SELECT COUNT(*) FROM 테이블 WHERE as_star_score >= t.as_star_score) AS rankingFROM 테이블 tWHER..