Database Tuning (MOSC)

MOSC Banner

Sql results wrong in Oracle 11G

edited Jun 14, 2011 5:38PM in Database Tuning (MOSC) 8 commentsAnswered
 HI,       When running the below testcode ,the select statement is  giving results is 10g,but not in oracle 11g

create table line_detail
(           ld_batch            varchar2(10) not null,
            ld_order             varchar2(10),
            ld_description    varchar2(100));
 

insert into line_detail(ld_batch, ld_order, ld_description)
values('B01', null, 'Invoice analysis');
 

commit;


10g
---------:
SQL> select *from line_detail
where ld_batch = 'B01'
and   NVL(ld_order, 'P123') is not null
and   NVL(ld_order, 'P123') = 'P123';  2    3    4    5 

LD_BATCH   LD_ORDER
---------- ----------
LD_DESCRIPTION
--------------------------------------------------------------------------------
B01
Invoice analysis


11g:
------------
SQL> select *
  2  from line_detail
  3  where ld_batch = 'B01'

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center