先看下面的语句:
select status from tbl
结果为:
1 DECOMMISSIONED
2 OPERATING
3 SCRAP
再执行下面的语句:
select status from tbl where status is not null
结果跟上面是一样的,返回三行数据记录。
接下来怪事来了,分别执行下面的四个语句,都没有返回一行数据记录:
>select status from a_tbl where status != ''and status is not null
>select status from a_tbl where status <> ''and status is not null
>select status from a_tbl where status <> ''
>select status from a_tbl where status != ''这令我十分不解,请问这是什么原因?
我的环境是9i2,在PL/SQL Developer里执行语句的,没有报错。我以前一直用SQL Server 2000,刚开始用Oracle,不知道哪不对,请知道的指点一二。