日期:2014-05-18 浏览次数:20589 次
SELECT Id,Title From NewsInfo Where class like '%58%' Order By Id DESC
------解决方案--------------------
WHERE CHARINDEX(',58,',','+class+',')>0
------解决方案--------------------
SELECT Id,Title From NewsInfo Where class like '%58%' Order By Id DESC
------解决方案--------------------
SELECT Id,Title From NewsInfo Where class like '%58%' Order By Id DESC
------解决方案--------------------
SELECT Id,Title From NewsInfo Where class like '%58%' Order By Id DESC
------解决方案--------------------
SELECT Id,Title From NewsInfo Where charindex('58,',class+',')>0 Order By Id DESC
------解决方案--------------------
SELECT Id,Title From NewsInfo Where ',' + class + ',' like '%,58,%' Order By Id DESC SELECT Id,Title From NewsInfo Where charindex(',58,' , ',' + class + ',') > 0 Order By Id DESC
------解决方案--------------------
declare @t table(a varchar(300)) insert @t select '39,58,61' insert @t select '50,28' insert @t select '66' insert @t select '83,88,89' select * from @t where a like '%58%' a --------------------- (所影响的行数为 2 行)
------解决方案--------------------
SELECT Id,Title From NewsInfo Where class like '%58%' Order By Id DESC
------解决方案--------------------
1、方法一
select id,title from newsinfo wher class like '%58%' order by id desc