Im between cherry

Hackerrank | MySQL | Weather Observation Station 9 본문

데이터분석/practice_query

Hackerrank | MySQL | Weather Observation Station 9

meal 2020. 8. 28. 09:02

Weather Observation Station 9

Problem

 

Weather Observation Station 9 | HackerRank

Query an alphabetically ordered list of CITY names not starting with vowels.

www.hackerrank.com

Query the list of CITY names from STATION that do not start with vowels. Your result cannot contain duplicates.

 

 

Solution

SELECT DISTINCT CITY
FROM STATION
WHERE SUBSTR(CITY, 1, 1) NOT IN ('a','e','i','o','u');
SELECT DISTINCT city
FROM station
WHERE city NOT REGEXP '^[aeiou]'
SELECT Distinct City
FROM Station
WHERE City NOT rLike '^[aeiou]'
Comments