R
Ranjit kurian
I hv three columns as shown below.
Name Month Amount
C72651 Dec-08 10
D398456-00 Dec-08 20
Y65148413 Dec-08 30
U1284563 Nov-08 40
T21645984 Oct-08 50
E8123321 Sep-07 60
I need a single query to convert the above rows into separate columns based
on month column as shown below
Name Dec-08 Nov-08 Oct-08 Sep-07
C72651 10 0 0 0
D398456-00 20 0 0 0
Y65148413 30 0 0 0
U1284563 0 40 0 0
T21645984 0 0 50 0
E8123321 0 0 0 60
Name Month Amount
C72651 Dec-08 10
D398456-00 Dec-08 20
Y65148413 Dec-08 30
U1284563 Nov-08 40
T21645984 Oct-08 50
E8123321 Sep-07 60
I need a single query to convert the above rows into separate columns based
on month column as shown below
Name Dec-08 Nov-08 Oct-08 Sep-07
C72651 10 0 0 0
D398456-00 20 0 0 0
Y65148413 30 0 0 0
U1284563 0 40 0 0
T21645984 0 0 50 0
E8123321 0 0 0 60