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.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Pivot table

Author  Topic 

FernandoLorival
Starting Member

19 Posts

Posted - 2011-04-06 : 10:46:54
Hey all,
I need some help with, I think to be the best solution, a pivot table..
I have this table:

MACHINE TOOL_ID PRIORITY RANKING
-------------- --------------------
101 39309 29.1593180482000 1
101 39310 169.1247002398000 2
101 39027 216.6666666666600 3
102 39363 0.0000000000000 1
102 39364 0.0000000000000 1
102 39920A 63.1970260223000 3
105 39448C 122.0646625070900 1
105 39302 170.2702702702700 2
105 39448D 664.2553191489300 3
106 39919A 50.9293680297300 1
106 39919 77.0833333333300 2
106 39462 187.5000000000000 3
107 39910 99.0662931839400 1
107 39918 115.9477124183000 2
107 39379 173.9583333333300 3

I need to display the data like this:

MACHINE [1] [2] [3]
101 39309 39310 39027
102 39363 39364 39920A
105 39448C 39302 39448D
106 39919A 39919 39462
107 39910 39918 39379

Thank you so much for all your help.

FernandoLorival
Starting Member

19 Posts

Posted - 2011-04-06 : 11:17:33
Thank you all for looking at this post.
I got it working...
Thanks again.
Go to Top of Page

nkshah
Starting Member

1 Post

Posted - 2011-04-06 : 13:55:23
I am also dealing with exact same problem for displaying data in pivot. Would you be able to post your solution? Were you able to include and display Priority column as well along with pivot?

N Shah
Go to Top of Page
   

- Advertisement -