How to find column data with a special character at the end

I have a HouseInfo column that contains both alphabets, number, and special characters.

Column Data Format: AANNNNX

where A is the symbol of the alphabet AZ, N is the number 0-9, and X can contain both the alphabet, number, and a special character, for example, "AB1234A", "AC32158" or "DK8954;"; or "DS5466:" or "SK1245>"

I am trying to write a query that finds a column that has only a special character only at the end. I tried something like this, but in this case I have to pass the entire special character to it.

select * from testtable where HouseInfo like '______[;,:,<,>,=]'

Is there a way to detect all special characters except the number and alphabet characters only in the end position?

+4
source share
2

SELECT * FROM testtable WHERE HouseInfo NOT LIKE '%[a-z0-9]'
+6

Like Not Like

Like:

SELECT * FROM testtable WHERE HouseInfo LIKE '%[@#$%]'

, ,

SELECT * FROM testtable WHERE HouseInfo NOT LIKE '%[a-z0-9]'
+1

All Articles