Last active
January 17, 2024 17:15
-
-
Save alivx/6705be7ded43c62f8d51f2c582a2bd2b to your computer and use it in GitHub Desktop.
Query the list of CITY names starting with vowels (i.e., a, e, i, o, or u) from STATION. Your result cannot contain duplicates.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Start with | |
select DISTINCT CITY from STATION where CITY rlike '^[a,e,i,o,u]'; | |
End with | |
select DISTINCT CITY from STATION where CITY rlike '[a,e,i,o,u]$'; | |
Both Start and end | |
select DISTINCT CITY from STATION where CITY rlike '^[a,e,i,o,u].*[a,e,i,o,u]$'; | |
SELECT DISTINCT CITY from STATION where CITY REGEXP '^[^aeiou].*[^aeiou]$'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
SELECT DISTINCT CITY
FROM STATION
WHERE CITY NOT REGEXP '^[aeiouAEIOU]';