一个SQL存储过程,有2参数 @condition 和 @conditionValue。 在当 @condition =''时;执行 select * from tb ;
否则 select * from tb where @condition lick '%'+@_conditionValue+'%'
为什么只有当 @condition=''时候能够查询出记录, 不为''时候 就查不出记录了??
上面的 lick 是like 打这里打错了
select * from tb where @condition like '%'+@_conditionValue+'%'
测试 @condition 也能传入进去 但是就是@_conditionValue 只要一有值 他就无数据了
有的
like ……是对的 我这里打错了
追答那,还是不出结果吗?
追问不是来 很奇怪……