Reviewing the original question leads me to think of something like this:
create table rob/hightower2 as(
select cast('1 ' as char(2)) AS breakid,
cast(crlocatn as numeric(3,0))as crlocatn,
cast(sum(cramount)as numeric(14,2)) as cramount
from rob/hightower
group by crlocatn
union all
select cast('0 ' as char(2)) as breakid,
cast(0 as numeric(3,0)) as crlocatn,
cast(sum(cramount) as numeric(14,2))cramount
from rob/hightower
) with data

although there's probably a better way to do that with grouping sets,
ROLLUP, CUBE or something in that genre.
And perhaps there's a way to get that control break leading data without
fudging it like I did.

select * from rob/hightower
....+....1....+....2..
CRLOCATN CRAMOUNT
397 67,884.83
397 1.00
399 90,067.23
399 1.00
******** End of data

dsppfm rob/hightower2
*...+....1....+....
1 39700000006788583
1 39900000009006823
0 00000000015795406


Rob Berendt

As an Amazon Associate we earn from qualifying purchases.

This thread ...

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.