select * from xx where a like '%' + @a +'%' 上面已固定; a -------- b b1 c c2 @a='b'时: a -------- b b1 @a等于什么时能只查到记录b?(查询语句不修改的情况下)
[quote=引用 3 楼 mynamexuerui 的回复:] like可以使用正则表达式进行过滤 create table #B(b char(10)) insert into #B(b) select 'b' union all select 'b1' select * from #B where b like '%b^%' drop table #B
create table #B(b char(10)) insert into #B(b) select 'b' union all select 'b1' select * from #B where b like '%b^%' drop table #B
select * from #B where b like '%b[^0-9]%'
like可以使用正则表达式进行过滤 create table #B(b char(10)) insert into #B(b) select 'b' union all select 'b1' select * from #B where b like '%b^%' drop table #B
22,210
社区成员
121,726
社区内容
加载中
试试用AI创作助手写篇文章吧