谢谢大家,我是测试n遍了呀,最终感觉还是不行才不可思议才向大家讨教,而且去掉not后又正常??

解决方案 »

  1.   

    select * from itemRecandd_table where  (supplement not like '%苏%' and repandter not like '%苏%'and tapeID not like '%苏%'and tapeType not like '%苏%' and firstplayColumn not like '%苏%'and columnName not like '%苏%') and (DateDiff(day,shootTime,getdate())<60000) andder by shootTime desc
      

  2.   

    可以用 sql 内置函数判断,没有必要用 likeselect * from itemRecandd_table where  (instr(supplement,'苏' = 0) and  ..... and (DateDiff(day,shootTime,getdate())<60000) andder by shootTime desc
      

  3.   

    你的写法是对的,有一点问题就是 not 前要加字段名
    select * from itemRecord_table where supplement  not (supplement like '%苏%' or reporter like '%苏%'or tapeID like '%苏%'or tapeType like '%苏%' or firstplayColumn like '%苏%'or columnName like '%苏%') and (DateDiff(day,shootTime,getdate())<60000) order by shootTime desc
      

  4.   

    谢谢各位,我验证出一个怪现象,如果每个字段不为空,结果没问题,当有NULL时就查不来了, 这可能是like 与NULL的内在规定作怪