Using Different Aggregate Functions in the Same COMPUTE BY Clause

You can use different aggregate functions in the same COMPUTE BY clause:

SELECT type, pub_id, price
FROM titles
WHERE type LIKE '%cook'
ORDER BY type, pub_id
COMPUTE SUM(price), MAX(pub_id) BY type


type
pub_id
price

--------
------
-----------

mod_cook
0877
2.99

mod_cook
0877
19.99



sum



==========



22.98






max



=====



0877






type
pub_id
price

---------
------
-----------

trad_cook
0877
11.95

trad_cook
0877
14.99

trad_cook
0877
20.95



sum



==========



47.89


max



=====



0877






(7 row(s) affected)