Click here to Skip to main content
15,888,113 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I have a table which have around 15 columns. I need pivoting on 6 columns.

TABLES looks as mentioned below with 10 col.
DATE	       ID	OP1	  DC1	OP2	DC2
29-Feb-16	A	NULL	10008	VO	0
01-Mar-16	A	NULL	10043.5	VO	0
02-Mar-16	A	NULL	10081.4	VO	0
29-Feb-16	B	AIRTEL	50940.2	VO	13668.7
01-Mar-16	B	AIRTEL	50951.1	VO	13679.6
02-Mar-16    	B	AIRTEL	50976.2	VO	13704.6


I need pivoting of above table like mentioned below:
			29-Feb-16	29-Feb-16	01-Mar-16	01-Mar-16
ID	OP1	OP2	DC1	          DC2	          DC1	          DC2
A	NULL	VO	10008	           0	        10043.5	           0
B	AIRTEL	VO	50940.2	        13668.7	         50951.1	13679.6

please suggest

What I have tried:

I am new in it, so i have not tired anything on the same.
Posted
Updated 3-Mar-16 2:23am
v2
Comments
Maciej Los 3-Mar-16 8:24am    
Seems you want pivoting on 1 column: DATE, not on 6 columns.

1 solution

You can look at my article[^] about pivoting
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900