Subject Re: [ib-support] Sum() on a subselect?
Author Helen Borrie
At 03:32 AM 26/05/2003 -0700, you wrote:

> >Guessing at what you are trying to achieve, i.e. a sum of all sums, I'd
> >suggest making a denormalised view of the inner nesting and then performing
> >a DSQL aggregation on that view at runtime...or put it into a selectable
> >stored procedure with two nested FOR loops.
>
>Yes, that's exactly it. I want a sum of sums. I was also thinking of
>making the inner sum a computed column, and then doing a sum() on the
>computed column. Is it legal to do a sum() on a computed column?

I don't see why not, if that works for you. You could pull
sum(MySummaryColumn) in as a scalar output for your original query spec. A
denormalised view would do the same thing. Why not try it both ways and
see which works better?

Helen