I think your earlier question, which digressed into CUBE and ROLLUP and
their newness in V6R1 was right on.

However, for backwards compatibility I tried this
with t1 as (
select 'D' as RecType, Dude, Moola as Money
from qtemp.thoma),
t2 as (
select 'S' as RecType, Dude, sum(Moola) as Money
from qtemp.thoma
group by Dude,1)
select * from t1
union
select * from t2
order by Dude, RecType, Money

I have one strange anomaly. I am missing one detail Tom record. Even
though the sum appears.
....+....1....+....2....+....
RECTYPE DUDE MONEY
D Tom 100
S Tom 200
D Will 50
D Will 200
S Will 250
******** End of data ********

However, if I change the first detail from 100 to 80 I then get
....+....1....+....2....+...
RECTYPE DUDE MONEY
D Tom 80
D Tom 100
S Tom 180
D Will 50
D Will 200
S Will 250
******** End of data *****

Rob Berendt

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.