请问一下大家 sql里面的 is  in 这两个语法在什么时候用,知道的朋友能详细说明吗?谢谢!

解决方案 »

  1.   

    --is,判断某字段为null
    --得到tablename 表中colname 列是null的数据
    select * from tablename where colname is null--in
    --得到id在1,2,4中的数据
    select * from tablename where id in (1,2,4)
      

  2.   

    is 要和 null 与not null 连在一起用 判断字段是否为空in 是包含的意思 ,后面跟着括号,因为里面是一个集合
      

  3.   

    联机丛书去看基础语法,有关in和is的,里面介绍的比较详细。
      

  4.   

    --is判断某字段为null,或不为空
    select * from 表名 where 字段 is null
    select * from 表名 where 字段 is not null
    --in  后面接集合..
    select * from 表名 where 字段 in (1,2,3,4)