Jump to content
Sign in to follow this  
MatteoW98

Like error: Last character

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? 

Share this post


Link to post
Share on other sites

You could try using a regular expression using RLIKE

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

 

Share this post


Link to post
Share on other sites

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'

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...