× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



At/after V5R4 you can use the RANK function to pull only the top 10 by
library. You'd union your result with another query that included SUM().
I'm not at V5R4 on the systems at my disposal.... Something like:

WITH totrows as
(select odlbnm, sum(odobsz) as libsize
from mytable
where odobtp<>'*LIB'
group by odlbnm)
, topten as (select odobnm, odobtp, odobtp, rank(see manual) as ranknbr
from mytable
...)
Select odlbnm, odobnm, odobtp, odobsz
From topten
Union
Select odlbnm, ' ', libsize
From totrows
)
Order by odlbnm, odobsz desc

Dennis Lovelady
http://www.linkedin.com/in/dennislovelady
--
"He who builds a better mousetrap these days runs into material shortages,
patent-infringement suits, work stoppages, collusive bidding, discount
discrimination - and taxes."
-- H.E. Martz


I want to generate results like the following from a table with those
columns, however, the summary row does not exist. And, of the detail,
I
only want the 10 largest rows per library.

Library Object Size
BIGLIB 456789
BIGLIB BIGOBJ 200000
BIGLIB MEDOBJ 100000
BIGLIB SMLOBJ 50000
...
MEDLIB 322457
MEDLIB BIGOBJ 150492
MEDLIB MEDOBJ 54329
MEDLIB SMLOBJ 12222
...
SMLLIB 105298
SMLLIB BIGOBJ 102201
SMLLIB MEDOBJ 49
SMLLIB SMLOBJ 2
...



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.