我需要匹配字符串转义单引号。这是我的查询的样子:
select Distinct(a.item)
from [dbo].[Subscribtions] a
where a.Item like 'Catch Fry''s Low Impact''
但这引发了错误
字符串“ Catch Fry's Low Impact”后面的引号引起来。
我不能使用like pattern matching%
有多个这样的字符串。出于某些数据原因,我=
只需要使用。
谢谢
寻找您的查询
select Distinct(a.item)
from [dbo].[Subscribtions] a
where a.Item like 'Catch Fry''s Low Impact''
'
最后一个要多,'Catch Fry''s Low Impact''
也不需要括号Distinct(a.item)
。
由于您'Catch Fry''s Low Impact'
实际上是在寻找,因此
select Distinct a.item
from [dbo].[Subscribtions] a
where a.Item like 'Catch Fry''s Low Impact';
将与
select Distinct a.item
from [dbo].[Subscribtions] a
where a.Item = 'Catch Fry''s Low Impact';
所以,我认为您只是在寻找
select Distinct a.item
from [dbo].[Subscribtions] a
where a.Item = 'Catch Fry''s Low Impact';
LIKE
除非您进行通配符匹配,否则使用运算符没有任何好处。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句