178. Rank Scores
Medium
์์ ํจ์ DENSE_RANK()
select score, `rank`
from (
select score, DENSE_RANK() over (order by Score desc) as `rank`
from Scores
) score_rank
order by `rank`;
- 176 Second Highest Salary ๋ฅผ ํ๊ณ ๋๋ ์ฝ๊ฒ ํ ์ ์๋ ๋ฌธ์ ์๋ค.
- ๊ทธ๋ฆฌ๊ณ ์ด ๋ฌธ์ ์์๋ ์น์ ํ๊ฒ๋ ์์ฝ์ด๋ฅผ ํ์ถํ๋ ค๋ฉด ์ดํผ์คํธ๋กํผ(`)๋ฅผ ์ฌ์ฉํ๋ผ๋ ํ๋ ์ค๋ค.
- Important Note: For MySQL solutions, to escape reserved words used as column names, you can use an apostrophe before and after the keyword. For example
Rank
.
'๐ฅ PS(Problem Solving) ๐ฅ > SQL' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[SQL] Leetcode | 176. Second Highest Salary (0) | 2021.07.07 |
---|---|
[SQL] ํ๋ก๊ทธ๋๋จธ์ค 7daySQL ์ฑ๋ฆฐ์ง Day 7 (0) | 2019.09.09 |
[SQL] ํ๋ก๊ทธ๋๋จธ์ค 7daySQL ์ฑ๋ฆฐ์ง Day 6 (0) | 2019.09.07 |
[SQL] ํ๋ก๊ทธ๋๋จธ์ค 7daySQL ์ฑ๋ฆฐ์ง Day 5 (0) | 2019.09.06 |
[SQL] ํ๋ก๊ทธ๋๋จธ์ค 7daySQL ์ฑ๋ฆฐ์ง Day 4 (0) | 2019.09.05 |
๋๊ธ