Sql wildcards only alphabet characters

I need to create a rule for alphabet characters only

I used the following wildcard character sequences, but not working!

LIKE '[A-Za-z]'

LIKE 'a-z'

LIKE 'A-Za-z'

+6
sql wildcard sql-server
source share
1 answer

Double negative like

WHERE SomeCol NOT LIKE '%[^az]%' 

Ignoring the first NOT, this means that "matches any character not in the range from a to z".

Then you change the use of the first NOT, which means "does not match any character not in the range from a to z"

Edit after comment

LIKE '%[az]%' means "find any one character between az. Thus, 111s222 matched, for example, because s matches this.

+13
source share

All Articles