A bit modified to get closer to the output shown by Praneet :-) . Although its based on Dieter's trick :-).
SEL ID1,
COALESCE((CASE WHEN ID2='A' THEN AMT END),'') AS A,
COALESCE((CASE WHEN ID2='B' THEN AMT END),'') AS B,
COALESCE((CASE WHEN ID2='C' THEN AMT END),'') AS C,
COALESCE((CASE WHEN ID2='D' THEN AMT END),'') AS D
FROM A
ORDER BY ID1
A bit modified to get closer to the output shown by Praneet :-) . Although its based on Dieter's trick :-).
SEL ID1,
COALESCE((CASE WHEN ID2='A' THEN AMT END),'') AS A,
COALESCE((CASE WHEN ID2='B' THEN AMT END),'') AS B,
COALESCE((CASE WHEN ID2='C' THEN AMT END),'') AS C,
COALESCE((CASE WHEN ID2='D' THEN AMT END),'') AS D
FROM A
ORDER BY ID1