如何搜索一个字段在改列中啊
如图我要包含 1 或者 8 的所有数据 SQL?数据库 查询语句?
[解决办法]
SELECT *
FROM tb
WHERE CHARINDEX(',1,', ','+PaymentUserID+',') > 0
OR CHARINDEX(',8,', ','+PaymentUserID+',') > 0
SELECT *
FROM tb
WHERE PaymentUserID like '%1%'
union
SELECT *
FROM tb
WHERE PaymentUserID like '%8%'