我们平常用的包含是 like '%字符%',
现在我要查询不包含某个内容的值怎么查,是模糊的,

解决方案 »

  1.   

    select * from tb where 字段 not like '%字符%'

    select * from tb where charindex('字符',字段)=0
      

  2.   

    col not like '%字符%'
    charindex('字符',col) = 0
      

  3.   

    頂. not like 效率比較低.
      

  4.   

    用not like 
    如:select * from tab where id not like '%a%'
      

  5.   

    not  like '%字符%
    完全正确
      

  6.   

    not like 
    charindex
    not in
    其实用not in也可以,但最好用charindex