0
select
  a.ACCOUNT_HOSPITAL, a.AMT_HOSP, b.ACCOUNT_DEBTOR , b.AMT_DEBTR     
from     
  (SELECT
     GTN.boepisodeaccount_ID as ACCOUNT_HOSPITAL, txn.TXN_AMT as AMT_HOSP
   FROM BOEPISODEACCOUNTTXN GTN, boepisodedebtortxn txn 
   WHERE GTN.BOEPISODEACCOUNTTXN_id = txn.BOEPISODEACCOUNTTXN_id AND
     gtn.boepisodeaccount_id =
      ( select boepisodeaccount_id from boepisodeaccount 
        where  episode_no ='A101200046'
      )
  ) a
  INNER JOIN
    ( select bd.boepisodeaccount_ID as ACCOUNT_DEBTOR, bdt.TXN_AMT AS AMT_DEBTR
      from boepisodedebtor bd, boepisodedebtortxn bdt 
      where bd.boepisodedebtor_id = bdt.boepisodedebtor_id 
      and bd.BOEPISODEACCOUNT_ID =
      ( select boepisodeaccount_id from boepisodeaccount 
        where  episode_no ='A101200046'
      )
    ) b
  ON a.ACCOUNT_HOSPITAL = b.ACCOUNT_DEBTOR
4

1 に答える 1