×

Good News Everybody!

The new search engine is LIVE!

Please report any problems to david (at) midrange.com.




I'm trying to add final totals to an SQL listing.
Struggling with the syntax a bit.

Below SQL lists all spoolfiles on the system, sorted descending by size

SELECT OUTQ, SPOOLNAME, size, pages, job_name, created
FROM QSYS2.OUTPUT_QUEUE_ENTRIES
ORDER BY SIZE desc

03/28/17 15:29:47 PAGE 1
OUTPUT_QUEUE_NAME SPOOLNAME SIZE PAGES JOB_NAME CREATED
TRCALL QPCSMPRT 2,099,224 335,953 748135/PRODUCT/TRCTSYSOFF 2017-03-28-10.30.01.954172
TRCALL QSYSPRT 1,968,152 390,495 748135/PRODUCT/TRCTSYSOFF 2017-03-28-10.34.16.861769
TRCALL QPCSMPRT 1,198,104 195,109 751230/PRODUCT/TRCTSYSOFF 2017-03-28-15.00.02.391903
TRCALL QSYSPRT 1,132,568 229,525 751230/PRODUCT/TRCTSYSOFF 2017-03-28-15.02.32.520147
CM_CYCLE QSYSPRT 329,748 131,756 314250/CPAGDEPU/S001BIL807 2017-02-15-02.04.28.807613
CM_CYCLE QSYSPRT 329,748 128,507 604539/CPAKFRAN/S001BIL807 2017-03-15-01.57.58.844694
CM_CYCLE QSYSPRT 313,364 125,650 381119/CPAGDEPU/S001BIL807 2017-02-22-01.54.56.171381
CM_CYCLE QSYSPRT 313,364 124,582 703277/CPAGDEPU/S001BIL807 2017-03-24-01.52.58.137695
....

I have a 2nd SQL showing only the sum.

SELECT sum(pages)
FROM QSYS2.OUTPUT_QUEUE_ENTRIES
SELECT statement run complete.

SUM ( SIZE ) SUM ( PAGES )
489,542,320 81,492,452

What I would like to see is the listing with the sum at the bottom.
Do I need a union to do this?
Or are their other choices/options?
I was reading some links.

Thank You
_____
Paul Steinmetz
IBM i Systems Administrator

Pencor Services, Inc.
462 Delaware Ave
Palmerton Pa 18071

610-826-9117 work
610-826-9188 fax
610-349-0913 cell
610-377-6012 home

psteinmetz@xxxxxxxxxx
http://www.pencor.com/


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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

This mailing list archive is Copyright 1997-2026 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.