728x90
❓ Question
https://www.hackerrank.com/challenges/weather-observation-station-6
❗ Answer
SELECT DISTINCT(city)
FROM station
WHERE LEFT(city,1) IN ('a','e','i','o','u');
📌 Discussion
- LEFT(column,num)으로 왼쪽부터 num번째까지의 데이터를 추출
- a IN b 으로 b안에 a가 있는 레코드만 추출
'SQL 문제풀이' 카테고리의 다른 글
[해커랭크 SQL] Basic Select - Weather Observation Station 8 (0) | 2023.08.18 |
---|---|
[해커랭크 SQL] Basic Select - Weather Observation Station 7 (0) | 2023.08.18 |
[해커랭크 SQL] Basic Select - Weather Observation Station 4 (0) | 2023.08.16 |
[해커랭크 SQL] Basic Select - Weather Observation Station 3 (0) | 2023.08.16 |
[해커랭크 SQL] Basic Select - Weather Observation Station 1 (0) | 2023.08.16 |