查询记录,包含某字符串,我是这样写的,不知道对不对select * from table where ziduan like "%abc%"查询记录,不包含某字符串的SQL语句怎么写呢?

解决方案 »

  1.   

    select * from table where ziduan not like "%abc%"
      

  2.   

    select * from table where ziduan not like "%abc%"select * from table where charindex('abc',ziduan)=0
      

  3.   

    select * from table where ziduan not like "%abc%"
      

  4.   

    select * from tablea where ziduan not like "%abc%"select * from tablea where charindex('abc',ziduan)<0补select * from tablea where patindex('%abc%',ziduan)<0
      

  5.   

    select * from tablea where ziduan not like "%abc%"