I have a huge sql which is written in old style join code and i am trying to change it to ansi join, i dint not paste the select query and just pasted the join condition for ease The ansi join is not producing any data, but the old one does.
Here is my old style join
select *****
from CHECKING_EXT_CASH_FLW_REP CS, OTP_ALL_REP TP_REP ,
(select M_LABEL,min(M_ALT_ID) as M_ALT_ID from ING_ALIAS_REP where M_ALT_SYS=@CtpAlternateSystem:C group by M_LABEL) CA,
(select M_LABEL,min(M_ALT_ID) as M_ALT_ID from ING_ALIAS_REP where M_ALT_SYS=@PtfAlternateSystem:C group by M_LABEL) PA
where TP_REP.M_REF_DATA=CS.M_REF_DATA
and TP_REP.M_TP_PFOLIO=CS.M_TP_PFOLIO
and TP_REP.M_NB=CS.M_NB
and CA.M_LABEL(+)=TP_REP.M_TP_CNTRPID
and PA.M_LABEL(+)=TP_REP.M_TP_PFOLIO
and CS.M_F_OBSCOM ='N'
i tried to convert it to ansi join and below is the code
select **********
from OTP_ALL_REP TP_REP
JOIN CHECKING_EXT_CASH_FLW_REP CS ON (TP_REP.M_REF_DATA=CS.M_REF_DATA and TP_REP.M_TP_PFOLIO=CS.M_TP_PFOLIO and TP_REP.M_NB=CS.M_NB )
RIGHT OUTER JOIN (select M_LABEL,min(M_ALT_ID) as M_ALT_ID from ING_ALIAS_REP where M_ALT_SYS=@CtpAlternateSystem:C group by M_LABEL) CA ON( CA.M_LABEL=TP_REP.M_TP_CNTRPID )
RIGHT OUTER JOIN (select M_LABEL,min(M_ALT_ID) as M_ALT_ID from ING_ALIAS_REP where M_ALT_SYS=@PtfAlternateSystem:C group by M_LABEL) PA ON (PA.M_LABEL=TP_REP.M_TP_PFOLIO)
The old code works but the latter does not , is there any thing that i am missing out on or do i have an issue with my conversion all together.