Prepare > SQL > Basic Select > Weather Observation Station 7
2023. 7. 10. 21:37ㆍHackerRank-My SQL
Weather Observation Station 7 | HackerRank
Query the list of CITY names ending with vowels (a, e, i, o, u) from STATION.
www.hackerrank.com
문제
Query the list of CITY names ending with vowels (a, e, i, o, u) from STATION. Your result cannot contain duplicates.
코드
SELECT DISTINCT(CITY) FROM STATION
WHERE RIGHT(CITY,1) REGEXP "A|E|I|O|U";
노트
SELECT DISTINCT(CITY) FROM STATION
WHERE RIGHT(CITY, 1) = 'A'
OR RIGHT(CITY, 1) = 'E'
OR RIGHT(CITY, 1) = 'U'
OR RIGHT(CITY, 1) = 'I'
OR RIGHT(CITY, 1) = 'O';
'HackerRank-My SQL' 카테고리의 다른 글
Prepare > SQL > Basic Select > Weather Observation Station 9 (0) | 2023.07.12 |
---|---|
Prepare > SQL > Basic Select > Weather Observation Station 8 (0) | 2023.07.12 |
Prepare > SQL > Basic Select > Weather Observation Station 6 (0) | 2023.07.09 |
Prepare > SQL > Basic Select > Weather Observation Station 5 (0) | 2023.07.08 |
Prepare > SQL > Basic Select > Weather Observation Station 4 (0) | 2023.07.08 |