Hi Praneeth,
select id1,
max(case when id2='A' then Amt end) as A,
max(case when id2='B' then Amt end) as B,
max(case when id2='C' then Amt end) as C,
max(case when id2='D' then Amt end) as D
from table a
group by 1;
You could also use three Outer Joins, but this is probably more efficient.
Dieter
Hi Praneeth,
You could also use three Outer Joins, but this is probably more efficient.
Dieter