日期:2014-05-16 浏览次数:20468 次
SQL> select 1 from dual where null=null;
SQL> select 1 from dual where null='';没有查到记录
SQL> select 1 from dual where ''='';
SQL> select 1 from dual where null is null;1
SQL> select 1 from dual where nvl(null,0)=nvl(null,0);1
SQL> select 1+null from dual; SQL> select 1-null from dual; SQL> select 1*null from dual; SQL> select 1/null from dual;查询到一个记录.
uPDAte table1 set 列1=NULL where 列1 is not null;现有一个商品销售表sale,表结构为:
create table sale (month char(6),sell number); insert into sale values('200001',1000); insert into sale values('200002',1100); insert into sale values('200003',1200); insert into sale values('200004',1300); insert into sale values('200005',1400); insert into sale values('200006',1500); insert into sale values('200007',1600); insert into sale values('200101',1100); insert into sale values('200202',1200); insert into sale values('200301',1300); insert into sale values('200008',1000); insert into sale(month) values('200009');(注意:这条记录的sell值为空)
commit;共输入12条记录
SQL> select * from sale where sell like '%';MONTH SELL
SQL> select * from sale where sell like '%' or sell is null; SQL> select * from sale where nvl(sell,0) like '%';