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

0

在 WHERE 子句中添加这个表达式a.AMT_HOSP <> b.AMT_DEBTR))

于 2013-02-28T07:50:15.713 回答