SQL Language (MOSC)

MOSC Banner

Is this internal Oracle SQL bug ?

edited Apr 4, 2016 8:22AM in SQL Language (MOSC) 6 commentsAnswered

Hi,

I think following query should return 'AAAA' also for VAL2 column. Is this a bug in database (12.1.0.2.0 Enterprise - 64bit Linux) or I am wrong ?

select t1.val1,

  (select val2

  from

    (select t2.val2

     from

      (select null id, 't2' tbl_name, 'BBBB' val2, 0 order_val from dual

       union all

       select null id, 't2' tbl_name, 'AAAA' val2, 1 order_val from dual

      ) t2

     where

      (t1.id is not null and t2.id = t1.id and t2.val2 is null)

      or

      (t1.id is null and t2.val2 = 'AAAA' /*same as t1.val1*/)

     order by t2.order_val

    )

  where rownum < 2 -- if removed, then ORA-01427 is thrown wrongly also

Tagged:

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