简体   繁体   English

通配符sql只有字母字符

[英]Wildcard characters sql only alphabet characters

I need to create a rule only for alphabet characters 我需要为字母字符创建一个规则

i used the following Wildcard character sequences but didn't work ! 我使用了以下通配符字符序列,但没有用!

LIKE '[A-Za-z]' 喜欢'[A-Za-z]'

LIKE 'a-z' 喜欢'a-z'

LIKE 'A-Za-z' 喜欢'A-Za-z'

Double negative like 双负像

WHERE
  SomeCol NOT LIKE '%[^a-z]%'

Ignoring the first NOT, this means "match any character not in the range a to z". 忽略第一个NOT,这意味着“匹配不在 a到z范围内的任何字符”。

Then, you reverse using the first NOT which means "don't match any character not in the range a to z" 然后,您使用反向第一NOT这意味着“没有任何字符不在范围内匹配到z”

Edit, after comment 评论后编辑

LIKE '%[az]%' means "find any single character between az. So 111s222 is matched for example because s matches in this like. LIKE '%[az]%'表示“在az之间找到任何单个字符。所以111s222匹配,例如因为s匹配就好了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM