like带参
商品表commodity,@remark2的值直接是字符串 string remark2=”测试商品”
select commodityid,price,commodityname,commoditycode from commodity where disabled=@disabled1 and remark like '%'+@remark2+'%'
in带参
商品表commodity,@commoditycodes的值直接是字符串 string commoditycodes=“‘c0001’,’c0002’,’c0005’”
exec('select commodityid,price,commodityname,commoditycode from commodity where disabled=0 and commoditycode in ('+@commoditycodes+') ')