日期:2014-05-18 浏览次数:21035 次
select * from a
where charindex(',92,', ','+brand+',')>0
------解决方案--------------------
select * from a where ','+brand+',' like '%,92,%'
------解决方案--------------------
select b.* from b , a where charindex(','+cast(b.id as varchar)+',',','+a.brands+',') > 0
------解决方案--------------------
--查全部
select b.* from b , a where charindex(','+cast(b.id as varchar)+',',','+a.brands+',') > 0
--只查92
select b.* from b , a where charindex(',92,',','+a.brands+',') > 0
------解决方案--------------------
漏了
select * from a
where brand like '%,92,%'
or brand like '92,%'
or brand like '%,92'