Jump to content

Like error: Last character


MatteoW98

Recommended Posts

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

You could try using a regular expression using RLIKE

SELECT City 
FROM Station 
WHERE City RLIKE '[aeiouAEIOU]$'; 

 

Link to comment
Share on other sites

  • 3 months later...

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

  • 1 month later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...