SQL 空值NULL 判断办法 以及非空值判断办法

来源:互联网 发布:淘宝联盟怎么下载不了 编辑:程序博客网 时间:2024/04/29 14:14

create database test
go
use test
go
create table test123
(
id int,
word varchar(50),
)
go
insert into test123 (id,word)values(1,'1')
insert into test123 (id,word)values(2,'2')
insert into test123 (id,word)values(3,'3')
insert into test123 (id,word)values(4,'4')
insert into test123 (id)values(6)
insert into test123 (id)values(7)
insert into test123 (id)values(8)
insert into test123 (id)values(9)
insert into test123 (word)values('10')

select * from test123

select * from test123 where   id is null
select * from test123 where   id is not null

select * from test123 where word is null
select * from test123 where word is not null

 
原创粉丝点击