문제
Query the list of CITY names from STATION that either do not start with vowels or do not end with vowels. Your result cannot contain duplicates.
Input Format
The STATION table is described as follows:
코드
SELECT distinct city
FROM Station
WHERE substring(city, -1) NOT IN ('a','e','i','o','u')
OR substring(city, 1, 1) NOT IN ('a','e','i','o','u')
- Station테이블에서 city이름의 첫글자나 끝글자가 모음이 아닌 컬럼 출력
- 중복 금지
정규식을 활용한 다른 방법도 차차 배울 예정 📝 그럼 밑에 추가해야지
출처
반응형
'Algorithm > MySQL' 카테고리의 다른 글
[해커랭크(HackerRank)] Average Population (MySQL) (0) | 2021.07.04 |
---|---|
[해커랭크(HackerRank)] Revising Aggregations - Averages (MySQL) (0) | 2021.07.04 |
[해커랭크(HackerRank)] Weather Observation Station 10 (MySQL) (0) | 2021.07.04 |
[해커랭크(HackerRank)] Weather Observation Station 9 (MySQL) (0) | 2021.07.04 |
[해커랭크(HackerRank)] Weather Observation Station 8 (MySQL) (0) | 2021.07.04 |