select * from table1 where column1 like '%京工商字@[2007]100号%' escape '@'
declare @t table (id int, name varchar(20), value varchar(20)) insert into @t select 1,'甲','京工商字[2007]100号'select * from @t where value like '%[[]2007]%'
or select * from table1 where charindex('京工商字[2007]100号',column1)>0
select * from #table1 where column1 like '%京工商字/[2007/]100号%' ESCAPE '/'
]--需要转义 declare @T table(Col nvarchar(100)) insert @T select '京工商字[2007]100号' select * from @T where Col like '%[2007[]]%'Col ---------------------------------------------------------------------------------------------------- 京工商字[2007]100号(所影响的行数为 1 行)
select * from table1 where column1 like '%京工商字[2007]100号%' 好象我也遇到过这样的问题 后来我用charindex来实现的 select * from table1 where charindex('%京工商字[2007]100号%' , column1)>0 这样就好使了 不知道为什么 可能是我写错了吧
LIKE ']' ]
insert into @t select 1,'甲','京工商字[2007]100号'select * from @t where value like '%[[]2007]%'
select * from table1 where charindex('京工商字[2007]100号',column1)>0
declare @T table(Col nvarchar(100))
insert @T select '京工商字[2007]100号'
select * from @T where Col like '%[2007[]]%'Col
----------------------------------------------------------------------------------------------------
京工商字[2007]100号(所影响的行数为 1 行)
好象我也遇到过这样的问题
后来我用charindex来实现的
select * from table1 where charindex('%京工商字[2007]100号%' , column1)>0
这样就好使了
不知道为什么
可能是我写错了吧