Nested Aggregate function help
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
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.
Click Here to Expand Forum to Full Width