1.在Varchar2的格式中‘’相當於null(都不分配內存)。
select '存在' aa from dual where '' is null
這句話的結果是存在的。
2.在Oracle中不能對null做邏輯判斷,只能使用is和is not。
select '存在' aa from dual where null = null;
select '存在' aa from dual where null <> null;
select '存在' aa from dual where 'aa' <> null;
select '存在' aa from dual where 'aa' <> '';
這四句話的結果都是不存在的(注意第三、四句話);
select '存在' aa from dual where null is null;
select '存在' aa from dual where 'aa' is not null;
這兩句話的結果是存在的;