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 |
|
Marioluccio2001
Starting Member
2 Posts |
Posted - 2010-04-20 : 11:38:49
|
| Hi guys,I have spent much time in converting row to column . This is an exampleTime A1 A2 A3 A4 A5 A6 A709:30 0 0 0 1 0 0 0 10:00 0 0 0 1 0 0 0 10:30 0 0 0 0 0 0 1 11:00 0 0 1 0 0 1 009:00 1 0 0 0 1 0 0I want to obtain this result: Time1 Time2 Time3 Time4 Time5 09:30 10:00 10:30 11:00 09:00 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 1 0 0Can anyone help me?Thanks. |
|
|
pk_bohra
Master Smack Fu Yak Hacker
1182 Posts |
Posted - 2010-04-20 : 11:49:53
|
| Have a look to below link.http://beyondrelational.com/blogs/madhivanan/archive/2008/08/27/dynamic-pivot-in-sql-server-2005.aspx |
 |
|
|
Marioluccio2001
Starting Member
2 Posts |
Posted - 2010-04-22 : 03:08:29
|
| Thanks for reply.I read the article but I still solved using a pair of supporting tables.Greetings |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-04-22 : 04:53:10
|
| why? isnt method in link easier than using two additional tableS?------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|
|