日期:2014-05-19  浏览次数:20632 次

刚才问的问题还没解决,请各位帮忙,在线
比如我们的产品中有     SM/W/JC   ,TY/JY,   LK/FK     SA/YU....     我想过滤掉其中的一部分产品。   如想过滤掉含有   SM,JT,FK   的   我用上面的试了一下不行.

------解决方案--------------------
select * from t where 字段 not like '%SM% ' and 字段 not like '%FK% ' and 字段 not like '%JT% '
------解决方案--------------------
select * from 表名 where patindex( '%[SM]% ',列名) = 0 AND patindex( '%JT]% ',列名) = 0 and patindex( '%[FK]% ',列名) = 0
------解决方案--------------------
select * from 表名 where charindex( 'SM ',列名) <1 AND charindex( 'JT ',列名) <1 and charindex( 'FK ',列名) <1