我想知道搜索字符串模式时'[_ ^ a _]%'和'_ [^ a] _%'之间的区别? [英] i want to know difference between ' [_^a_]%' and '_[^a]_%' while searching a string pattern?

查看:91
本文介绍了我想知道搜索字符串模式时'[_ ^ a _]%'和'_ [^ a] _%'之间的区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从老师那里选择*,其名字如'_ [^ a] _%'



从老师那里选择*,其名字如'[_ ^ a _]%'

Select * from teacher where firstname like '_[^a]_%'

Select * from teacher where Firstname like '[_^a_]%'

推荐答案

请参阅 http:// msdn。 microsoft.com/en-us/library/ms179859.aspx [ ^ ]



[]表示列表和_单个字符,因此{_ ^ a_]有点矛盾。它会运行,但基本上是错误的。



'_ [^ a] _%'将返回第二个字符不是a
See http://msdn.microsoft.com/en-us/library/ms179859.aspx[^]

[] indicates a list and _ a single character so {_^a_] is a bit contradictory. It will run but is a basically wrong.

'_[^a]_%' will return everything where the second character is not an a

<的所有内容BR />


这篇关于我想知道搜索字符串模式时'[_ ^ a _]%'和'_ [^ a] _%'之间的区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆