sum(case when prod_id=1 then 1 else 0 end) prod_id_1,

sum(case when prod_id=2 then 1 else 0 end) prod_id_2,

sum(case when prod_id=3 then 1 else 0 end) prod_id_3,

sum(case when prod_id=4 then 1 else 0 end) prod_id_4,

sum(case when prod_id=5 then 1 else 0 end) prod_id_5

from tbl

group by cust_id, date