--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)
is 要和 null 与not null 连在一起用 判断字段是否为空in 是包含的意思 ,后面跟着括号,因为里面是一个集合
联机丛书去看基础语法,有关in和is的,里面介绍的比较详细。
--is判断某字段为null,或不为空 select * from 表名 where 字段 is null select * from 表名 where 字段 is not null --in 后面接集合.. select * from 表名 where 字段 in (1,2,3,4)
--得到tablename 表中colname 列是null的数据
select * from tablename where colname is null--in
--得到id在1,2,4中的数据
select * from tablename where id in (1,2,4)
select * from 表名 where 字段 is null
select * from 表名 where 字段 is not null
--in 后面接集合..
select * from 表名 where 字段 in (1,2,3,4)