oracle is null 和is not null

当字符串为空时,在where 使用 is null来判断。

当字符串不为空时,在where 使用 is not null来判断。

例如:

create table test
(
   stuno number(10) primary key,
   stuname varchar2(50)
)
insert into test(stuno) values(10)
insert into test(stuno,stuname) values(11,' ')

select * from test where stuname is null才会取到所有值。

而select * from test where stuname=''不行。

posted @ 2010-12-09 14:56  chinaifne  阅读(16445)  评论(1编辑  收藏  举报