MatteoW98 Posted May 5, 2019 Share Posted May 5, 2019 Hello everyone, i must do a query that finds all words that finish whit a,e,i,o or u. i' ve used this query but my output in empty . select City from Station where City like '%[aeiou]'; i' ve used the wildcards wrongly? Link to comment Share on other sites More sharing options...
Funce Posted May 5, 2019 Share Posted May 5, 2019 You could try using a regular expression using RLIKE SELECT City FROM Station WHERE City RLIKE '[aeiouAEIOU]$'; Link to comment Share on other sites More sharing options...
ishan_shah Posted August 28, 2019 Share Posted August 28, 2019 Hello, I have tried the following query. I hope it will work for you also. select * from [table_name ]where SUBSTRING(col_name,len(col_name),len(col_name)) in ('a','e','i','o','u'); Or in case of case sensitivity, you should try following query. select * from TABLE_NAME where SUBSTRING(COL_NAME,len(COL_NAME),len(COL_NAME)) in ('a','e','i','o','u','A','E','I','O','U') I have tried other one query also. It is as follows: select * from TABLE_NAME where (RTRIM(COL_NAME)) like '%a' or (RTRIM(COL_NAME)) like '%e' or (RTRIM(COL_NAME)) like '%i' or (RTRIM(COL_NAME)) like '%o' or (RTRIM(COL_NAME)) like '%u' Link to comment Share on other sites More sharing options...
shaili_shah Posted October 23, 2019 Share Posted October 23, 2019 https://stackoverflow.com/questions/36627613/sql-query-to-check-if-a-name-begins-and-ends-with-a-vowel SELECT DISTINCT city FROM station WHERE city RLIKE '*[aeiouAEIOU]$' Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now