日期:2014-05-16  浏览次数:20490 次

ORACLE 空置NULL作为判断的使用

NULL在ORACLE中不是空,而是一个不确定值,所以当作为条件来判断是否为空时不能使用' and test='' '? 或者' and test<>'' ' 'test1<>test2' (这个判断会把TEST1,TEST2其中之一为NULL时过滤掉),? 使用NVL(TEST1,'0')<>NVL(TEST2,'0'),添加默认值。

判断是为空' test is null ' or 'test is not null'