Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
mitasid
Yak Posting Veteran
51 Posts |
Posted - 2006-06-14 : 19:23:31
|
Hi i want to convert rows to columns in my table.my rows are jan,feb,mar,apr,.....deci want to convert them into columnshow shall i do that????? |
|
nosepicker
Constraint Violating Yak Guru
366 Posts |
Posted - 2006-06-14 : 20:39:46
|
Use the CASE statement:SELECTCASE WHEN YourColumn = 'jan' THEN ... END AS [jan],CASE WHEN YourColumn = 'feb' THEN ... END AS [feb],... |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
|
|