SQL Performance (MOSC)

MOSC Banner

Oracle 10.2.0.5 "wrong result when using with clause"

edited Aug 13, 2015 2:55AM in SQL Performance (MOSC) 3 commentsAnswered

Hi everyone,

I'm getting wrong result within an Oracle With Clause Statement ! the wrong result are related to the filter in where condition, row_number = 15

with tab_with as
   ( select null company, null wjfrom, null wjto, null basis_level from dual where 1=2
       union select '57', '201501', '201507', 'S' from dual
       union select '67', '201501', '201507', 'S' from dual
       union select 'DR', '201501', '201507', 'S' from dual )
select s.company, s.branch, s.period, s.bkw, s.hrg, s.tx, s.txart
                , last_day(to_date(to_char(s.period, 'fm999999'),'yyyymm')) lastday
                , m.from_d
                , m.to_d
                , m.prct
from tt@tt_link s , ts@ts_link   m , tab_with w
where s.period = 201507
  and s.branch = 126
  and m.art = s.txart 
 

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