furin_kazan furin_kazan - 27 days ago 9
SQL Question

Select a value ending in letters from a list of values

I have a column which has a data type of

varchar(25)
, while the values in the column could be something like
'89009', 'HS123','4491AU', '44989EA'
.

How do I select values of which the LAST TWO digits are not numbers but letters?

In this case how do I select only '4491AU' and '44989EA'

Please advise.

Thank you all. Problem solved

Answer

Use like:

where col like '%[a-zA-Z][a-zA-Z]'

or, if you just want non-digits:

where col like '%[^0-9][^0-9]'