I have the following table :
And I would like to make a query to obtain the following result :
I tried something like :
select Column1, Column2, Column3, case when Column4 = 'Data1' then Account end as Data1, case when Column4 = 'Data2' then Account end as Data2, case when Column4 = 'Data3' then Account end as Data3 from mytable group by Column1, Column2, Column3
But instead I got the following :
It seems that
group by stops at the first distinct line, therefore it stops reading lines with
One, Two Three once it found one, and of course same with
Five, Six, Seven, therefore it only fills the
Data columns according to the first match.
How can I get to my desired behaviour ?
Thanks in advance.