Skip to Main Content

Japanese

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

NULLと空文字の違いについて

1007466May 7 2013 — edited May 8 2013
以下のSQLをバージョンが異なる2環境で流したところ
結果が変わる事象が発生しました

select *
from (select *
from hogeA
where columnA is null
and ROWNUM = 1) hoge
where NVL(hoge.columnA, '') NOT IN (SELECT hoge2.columnB
FROM hoge2);

バージョンは
10.2.0.5.0と
11.2.0.3.0

10では結果が1件返され
11では何も返されませんでした。
※データは同じデータをimportして使用しています。

どうもバージョンによって
NVL(hoge.columnA, '')
の受け取り方が異なるようです。
10gの環境は別会社が設定を行い資料が残っていないようでどうやったのか困っています
nullと空文字を区別するしないのパラメータなどORACLEにありますでしょうか。

なお当然ですが、
NVL(hoge.columnA, '')

NVL(hoge.columnA, '0')
とすると双方とも表示されます

よろしくお願いいたします
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 5 2013
Added on May 7 2013
3 comments
7,488 views