c是变量
c=1的时候查询 流水号是1开头的并且包含下划线的
select count(*) from taiwei where liushuihao like '(c+"\_%")' escape '\'
谁帮我解决一下,试了好多方法都不行
declare @c as varchar(10) --是字符串型吧?set @c = '1%'select count(*) from taiwei where liushuihao like @c and liushuihao like '%_%'
select count(*) from taiwei where liushuihao like '(c+"%\_%")' escape '\'
这个方法更简单! 学习了
楼上的好像暑假时候的我,都找老帖子看