作者:厦禾Jimmy_218 | 来源:互联网 | 2023-05-19 18:17
like带参商品表commodity,@remark2的值直接是字符串stringremark2”测试商品”selectcommodityid,price,commoditynam
like带参
商品表commodity,@remark2的值直接是字符串 string remark2=”测试商品”
select commodityid,price,commodityname,commoditycode
from commodity
where [email protected] and remark like '%'[email protected]+'%'
in带参
商品表commodity,@commoditycodes的值直接是字符串 string commoditycodes=“‘c0001’,’c0002’,’c0005’”
exec('select commodityid,price,commodityname,commoditycode
from commodity
where disabled=0 and commoditycode in ('[email protected]+')
')