Data Analyst KIM
[SQL/Leetcode] 178. Rank Scores 본문
반응형
LeetCode - The World's Leading Online Programming Learning Platform
Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview.
leetcode.com
<문제>
<문제 풀이 및 코드>
이 문제는 DENSE_RANK를 사용하면 되는 간단한 문제였음 + AS 이후 'Rank'처럼 따옴표를 사용해주는 것이 포인트
SELECT Score
, DENSE_RANK() OVER (ORDER BY Score DESC) AS 'Rank'
FROM Scores
반응형
'데이터 분석 > Coding Test' 카테고리의 다른 글
[Coding Club] 2023.11.10 (0) | 2023.11.13 |
---|---|
[Leetcode] 1204. Last Person to Fit in the Bus (0) | 2023.11.13 |
[Leetcode] 608. Tree Node (0) | 2023.11.09 |
[Leetcode] 1393. Capital Gain/Loss (0) | 2023.11.09 |
[MySQL] 자동차 대여 기록 별 대여 금액 구하기(프로그래머스) (0) | 2023.11.03 |