Using different aggregates in the same compute clause

You can use different aggregates in the same compute 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 
 
Compute Result:
--------------- ----
          22.98 0877 
 
type        pub_id  price 
----------- ------- --------------
trad_cook   0877            11.95 
trad_cook   0877            14.99 
trad_cook   0877            20.95 
 
Compute Result:
--------------- ----
          47.89 0877
 
(7 rows affected)