Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2008
    Posts
    6

    Unanswered: Problem with Oracle statement-group by error

    I am trying to get the sum for the submitted amount column but there are duplicate values for submitted amount for each claim number(clapaytrannum). I can't get around it. If I use sum with nvl it will give me the sum including the duplicate values. If I remove the sum it will error saying not a single-group goup function and I don't want to group submitted amount. Does anyone have any ideas. Here is the select statement:

    Select max(claimtran.payeename) as PayeeName, nvl(claimtran.submittedamount,0) as submittedamount,min(to_char(claimtran.fromserviced ate, 'Month DD, YYYY')) as fromservicedate,max(to_char(claimtran.toservicedat e, 'Month DD, YYYY')) as toservicedate,max(claimtran.actioncode) as actioncode,sum(claimtran.paymentamount) as paymentamount,max(claimtran.clapaytrannum) as clapaytrannum,max(to_char(claimtran.checkdate, 'Month DD, YYYY')) as checkdate from claimtran where claimtran.clapaytrannum='803539' order by payeename
    Last edited by mldardy; 11-04-08 at 12:52.

  2. #2
    Join Date
    Oct 2008
    Posts
    6
    I figured it out.

    Thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •