Click here to Skip to main content
15,891,184 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I haven't used pivot table till now.

Could you please help me how to Split one row into multiple rows and multiple columns using Pivot table in SqlServer.?

Thanks for ur help in advance.!

Thanks
venkat.
Posted
Comments
Herman<T>.Instance 16-Sep-11 6:46am    
maybe add an example of how your data looks in 1 row and how you want it to be in more rows
venkatrao palepu 16-Sep-11 6:55am    
Hi digimanus,

Thanks for immediate reply.

i have data in one row. see below how it would be

ID Username Planned Done Remaining year1 year2 year3
153 venkat 13 6 7 20 15 5

i need this data like this.

username Current Year
planned venkat 13 20
Done venkat 6 15
remaining venkat 7 5

please help me.
Herman<T>.Instance 16-Sep-11 6:57am    
aha...you need to UnPivot!
Piyush Patell 11-Apr-12 23:46pm    
He buddy,

Have got any solution for above problem ? if yes can you please mention it here.

Thanks,
Piyush Patel
venkatrao palepu 16-Sep-11 7:01am    
Could you please help me how to do this one.?

 
Share this answer
 
v2
Comments
sachin10d 16-Sep-11 6:53am    
nice article digimanus!
 
Share this answer
 
v2
Comments
Herman<T>.Instance 16-Sep-11 6:58am    
good links my friend
sachin10d 11-Oct-11 8:27am    
thanks digimanus

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