with
temp1 as (select pub_name, max(c_price) as maxprice
from book group by pub_name),
temp2 as (select pub_name, maxprice from temp1
where maxprice = (select max(maxprice) from temp1) )
select case when t.maxprice = t2.maxprice then '*' else '' END,
k.pub_name, isbn, author, title, c_price
from book k, temp1 t , temp2 t2
where k.pub_name = t.pub_name and
k.c_price = t.maxprice
order by k.pub_name;
source: http://www.cs.newpaltz.edu/~pletcha/DB/db2_TempTables.html


