写了个sql 语句
select * from product where title like '%'+@param+'%'
查到21个记录
但是
select * from product where title like '%'+@param+'%'and code like '%%'
就一条都没有了
很奇怪
查了一下code列,原来这列值是可空的
改了下sql 实用 isnull()函数
select * from product where title like '%'+@param+'%'and isnull(code,'') like '%%'
查询就没有问题了