반응형

저장된 데이터




Select a.uid, a.user_score, count(a.uid) as ranking from tb_user_rank a, tb_user_rank b where a.user_score < b.user_score OR a.uid=b.uid GROUP BY a.uid ORDER BY ranking LIMIT 30



실행후 위와 같이 랭킹이 정리 되었습니다.





반응형

'MySql,MsSql' 카테고리의 다른 글

[MySql] left join시 조건 설정 방법  (0) 2013.01.31
[sql] null 을 제외한 오름차순 정렬 쿼리  (0) 2013.01.26

+ Recent posts