I was trying to solve a problem in SQL and I came across the problem:
Query the list of CITY
names from STATION
table that do not start with vowels. Your result cannot contain duplicates.
I used regexp_like()
function using Oracle but how I can query the results using MySQL?
In Oracle I did regexp_like(city, '^[^aeiou]', 'i')
MySQL has a REGEXP
keyword for just such an occasion.
SELECT ...
FROM ...
WHERE field REGEXP 'expression';
See: http://dev.mysql.com/doc/refman/5.7/en/regexp.html (first Google result for MySQL REGEXP)
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