안녕하세요
아래의 SQL을 오라클8i 에서 돌아갈수 있도록 INNER SQL 을 변환하고 싶습니다.
고수님의 가르침을 부탁드립니다.
SELECT APJ01T.NBIRAI AS No
, IIf(Left([KIJNL],3)="MP2","I/F",[NBJNL]) AS NO2
, APJ01T.NBCCT AS NO3
, APJ01T.CDSECPAY AS sect
, APJ01T.DTCOLPAY AS dday
, APJ01T.CDTORI AS CD
, Left([CDTORI],5) AS CD1
, Right(Trim([CDTORI]),3) AS CD2
, APJ01T.CDPAY AS CD3
, Left([CDPAY],5) AS CD4
, Right(Trim([CDPAY]),3) AS CD5
, APJ01T.DTJNLINPUT AS dday1
, APJ01T.CDEMPINPUT AS CD6
, Right("00000" & Left([CDEMPINPUT],3),5) AS CD7
, Right(Trim([CDEMPINPUT]),3) AS CD8
, IIf(APJ01T.KIAPR='0','A',IIf(APJ01T.KIAPR='1','B',IIf(APJ01T.KIAPR='2','C','-'))) AS accept
, APJ02T.MNSUM AS total
FROM APJ01T INNER JOIN APJ02T ON (APJ01T.NBIRAI = APJ02T.NBIRAI) AND (APJ01T.DTCOLPAY = APJ02T.DTCOLPAY) AND (APJ01T.CDSECPAY = APJ02T.CDSECPAY) AND (APJ01T.CDCO_ = APJ02T.CDCO_) AND (APJ01T.KIDEL = APJ02T.KIDEL)
GROUP BY APJ01T.NBIRAI
, IIf(Left([KIJNL],3)="MP2","I/F",[NBJNL])
, APJ01T.NBCCT
, APJ01T.CDSECPAY
, APJ01T.DTCOLPAY
, APJ01T.CDTORI
, Left([CDTORI],5)
, Right(Trim([CDTORI]),3)
, APJ01T.CDPAY
, Left([CDPAY],5)
, Right(Trim([CDPAY]),3)
, APJ01T.DTJNLINPUT
, APJ01T.CDEMPINPUT
, Right("00000" & Left([CDEMPINPUT],3),5)
, Right(Trim([CDEMPINPUT]),3)
, IIf(APJ01T.KIAPR='0','A',IIf(APJ01T.KIAPR='1','B',IIf(APJ01T.KIAPR='2','C','-')))
, APJ02T.MNSUM
, APJ01T.KIDEL
, APJ01T.CDCO_
HAVING (((APJ01T.KIDEL)="0") AND ((APJ01T.CDCO_)="01"))
ORDER BY APJ01T.NBIRAI
, IIf(Left([KIJNL],3)="MP2","I/F",[NBJNL])