比如某字段col  求的此字段不包括如下字符的行数'ds'
'fd'
'89'很多很多

解决方案 »

  1.   

    如果很多很多,建议建一个TB2表,COL字段,把内容装进去.
    然后select tb1.* from tb1 where charindex(tb2.col,tb1.col) = 0
      

  2.   

    [code=SQL]select count(*) from tb where col not like '%ds%' and col not like '%fd%' and col not like '%89%' /code]
      

  3.   

    select count(*) from tb where col not like '%ds%' and col not like '%fd%' and col not like '%89%'
      

  4.   

    建表不大可能,其实可不是很多,估计不到15个吧。就是把个人blog给排除。我想用weibo  blog  这样字样的给排除即可。欢迎提供有价值的方案。
      

  5.   

    如果是同时查询不存在这些内容.
    貌似只能用and来做了.
    select t.* from tb1 where charindex('ds',tb1.col) = 0 and charindex('fd',tb1.col) = 0 and ...
      

  6.   

    你将很多很多的作为一个临时表,然后用not in或not exists等去处理。
      

  7.   

    在来源网址中把个人blog给排除。
      

  8.   

    如果只有15个,那就用and连接.
    select * from tb1 where charindex('ds',col) = 0 and charindex('fd',col) = 0 and ... 
    或者是like
    select * from tb1 where col not like '%ds%' and col not like '%fd%' and ...
     
      

  9.   

    15个也不少了 and连接 再加上like 模糊查询的话效率极低 可以把那15个构建成一张临时表,用not exists来匹配