iam new to sql and i would like to know how can I find the letter or symbol at the end of value in column called Name
?
E.g if i would find something i will write select * from 'table' where 'Name' like '%es%'
but it will find me all rows contains es
Lets say - lesl, pespe, mess
... but how to write select which will select just values with 'es'
At the end of word? ... using regex
i will use es\Z
..... thanks in advance!
You have to remove the last %
, so it will only select words ending with es
.
select * from table where Name like '%es'
You're currently matching on: ..where 'Name' like '%es%'
.
Which equates to anything, then 'es' then anything else
.
Removing the last %
changes the where to
anything then 'es'
.
in short.. you need ..where 'Name' like '%es'
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