select
    a.date,
    b.name,
    sum(case when a.date=b.date1 then b.quantity end) as Date1Quantity,
    sum(case when a.date=b.date2 then b.quantity end) as Date2Quantity,
    sum(case when a.date=b.date3 then b.quantity end) as Date3Quantity
from
    (select distinct date1 as date from test 
     union 
     select distinct date2 from test
     union 
     select distinct date3 from test) a,Test b
group by
    a.date,b.name