I'm trying to query the list of CITY names from table - STATION that do not start with vowels with results that cannot contain duplicates. The table just has id, city, population
This is the query that I've written
SELECT DISTINCT CITY FROM STATION
WHERE CITY RLIKE '[^bcdfghjklmnpqrstvwxyzBCDFGHJKLMNPQRSTVWXYZ].*';
This gives a wrong answer. What am I doing wrong here?
try this.
SELECT DISTINCT CITY
FROM STATION
WHERE CITY NOT RLIKE '^[aeiouAEIOU].*$'
I tried this.
select distinct city
from station
where substring(city,1,1) not in('A','E','I','O','U');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With