>You'll want to group by baloons,color and probably take a sum of each of the case statements.
>Sim
yes, hard to believe I did not notice that. Thank you, the working query is:
select baloons, color,
max(case when dayofpurchase = '2011-01-01' then amountpur ELSE NULL END) as "first",
max(CASE when dayofpurchase = '2011-01-02' then amountpur ELSE NULL END) as "second",
max(CASE when dayofpurchase = '2011-01-03' then amountpur ELSE NULL END) as "third"
from modvalues
group by baloons, color