-- 예시 쿼리
SELECT name, attack,
RANK() OVER (ORDER BY attack DESC) AS attack_rank
FROM pokemon.mypokemon;
결과
RANK / DENSE_RANK / ROW_NUMBER()
사용 형식은 셋 모두 같다.
SELECT name, attack,
RANK() OVER (ORDER BY attack DESC) AS rank_rank,
DENSE_RANK() OVER (ORDER BY attack DESC) AS rank_dense_rank,
ROW_NUMBER() OVER (ORDER BY attack DESC) AS rank_row_number
FROM mypokemon;