Nested Aggregate function help
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 2 of 2

Thread: Nested Aggregate function help

  1. #1
    Join Date
    Aug 2006
    Posts
    1

    Nested Aggregate function help

    Hello,
    I'm trying to add a number of columns and then create a percentage as the result and place that result into a aliased column. I can't see where my error is but I'm getting a error that my nest is too deep. Can anyone help point out where I have gone wrong?

    ,round(SUM(SRTBEG + SRTEND + PRTBEG + PRTEND + (SUM(ICALLS - (SUM(SRTBEG + SRTEND + PRTBEG + PRTEND
    + NDDWRT + SETBEG + SIDERT + SCLERT + SDBERT + SDSERT + SBAERT + PETBEG + PIDERT + PCLERT + PDBERT
    + PDSERT + PBAERT + PTIDET + SREIMB + SNODET + PNODET + PTIDMT))))*100,2) || '%' Percentage) c7

  2. #2
    Join Date
    Aug 2002
    Location
    Colorado Springs
    Posts
    5,253
    SUM(A+ SUM(B) - SUM(C)) doesn't really make sense. Better to just write SUM(A+B-C) or SUM(A)+SUM(B)-SUM(C) -- the two are different because of the treatment of NULL values.
    David Aldridge,
    "The Oracle Sponge"

    Senior Manager, Business Intelligence Development
    XM Satellite Radio
    Washington, DC

    Oracle ACE

Posting Permissions

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



Click Here to Expand Forum to Full Width