문제 URL : https://solvesql.com/problems/olympic-cities/

 

https://solvesql.com/problems/olympic-cities/

 

solvesql.com

 

* 문제 저작권으로 인하여 직접 작성한 쿼리문만 첨부

select year, upper(substring(city,0,4)) as city
from games
where year > 1999
order by year desc

 

substring(자를 문자열, startIdx, endIdx) - startIdx부터 endIdx 직전까지(포함X) 문자열을 잘라 반환

upper(문자열) - 문자열 내 문자를 모두 대문자로 변환하여 반환

+ Recent posts