查找 一列中 不包含 什么什么的  语句 怎么写

解决方案 »

  1.   

    declare @a nvarchar(100)
    select @a=N'什么什么'select * from tb where 列 not like '%'+@a+'%'
      

  2.   

    或者 select * from tb where charindex(@a,列)<0
      

  3.   

    where col!='xxx' --1个值where col not in('xxx1','xxx2') --多个值
      

  4.   

    not like 

    not in
      

  5.   

    not in
    not like
    not exists
      

  6.   

    这位大姐,你这三个都对,可是格式没有写全呀~,像小弟这种小白还是不知怎么用的~呵呵,谢谢
    2楼的兄弟提供的这个  select * from tb where 列 not like '%'+@a+'%'
      

  7.   

    比如 
    select * from member where id no like '%sdf%'
      

  8.   

    发2个教程吧SQL中IN,NOT IN,EXISTS,NOT EXISTS的用法和差别
    http://apps.hi.baidu.com/share/detail/10276644SQL模糊查询LIKE的用法
    http://edu.codepub.com/2010/0608/23357.php
      

  9.   

    列中不包括ds这两个字母
    select * from tableName 
    where colName not like '%ds%'
      

  10.   

    select * from 表名
    where 列名 like not in(“xx1”,xx2","……",)xx1为多个值中一个
      

  11.   

    没有like,被人一打扰,写错,不好意思,更正下,如下:
    select * from 表名
    where 列名  not in(“xx1”,xx2","……",)xx1为多个值中一个
      

  12.   

    SELECT *
    FROM Table1
    WHERE (title NOT IN ('拉丁神灯', '数学'))
    SELECT *
    FROM Table1
    WHERE (title NOT LIKE '%拉丁神灯')