본문 바로가기

TIL 통합/SQL

UNION, 정규표현식

카타

 

<문제 137. Weather Observation Station 5 : UNION>

(SELECT city,
        length(city)
FROM STATION
ORDER BY length(CITY) ASC,CITY ASC
limit 1)

union

(select city,
        length(city)
from station
order by length(city) desc, city asc
limit 1)

잠시 헷갈렸던 문제라 기록

 


<문제 138. Weather Observation Station 6 : 정규표현식>

select city
from station
where city regexp '^[aeiou]'

어제 새로 공부했던 정규표현식을 바로 써먹었던 문제라 복습 차원에서 기록.