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 |
eljapo4
Posting Yak Master
100 Posts |
Posted - 2012-08-31 : 10:46:57
|
Hi I've the following sample of dataID ModelNumber FanSpeed MeanWaterTemp Performance1 SRX080M 1 30 1631 SRX080M 1 33 2041 SRX080M 1 35 2451 SRX080M 1 38 2861 SRX080M 1 40 3271 SRX080M 1 43 3681 SRX080M 1 45 4091 SRX080M 2 30 3141 SRX080M 2 33 3941 SRX080M 2 35 4741 SRX080M 2 38 5541 SRX080M 2 40 6341 SRX080M 2 43 7141 SRX080M 2 45 7941 SRX080M 3 30 4851 SRX080M 3 33 6131 SRX080M 3 35 7411 SRX080M 3 38 8691 SRX080M 3 40 9961 SRX080M 3 43 11241 SRX080M 3 45 1252 Is it possible for me to pivot this data with SQL query so it looks like ID (X-Axis) FanSpeed (Y-Axis) MeanTemp (Sub-(Y-Axis)) Performance (Z-Axis) |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-08-31 : 11:18:45
|
this looks more of report format rather than pivoting. this format can be very easily achieved using reporting tools like SSRS using nested containers------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
eljapo4
Posting Yak Master
100 Posts |
Posted - 2012-09-03 : 03:51:17
|
I need to diplay this data in an asp.net application and was thinking that it may be easier to manipulate the SQL results into a pivot format rather than the gridview within the application itself |
 |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-09-03 : 15:25:50
|
the format cant be obtained using sql query unless you apply some ugly conditional logicthe way you should be doing this is using flattened sql query and doing the required formatting after populating recordset in .net------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
eljapo4
Posting Yak Master
100 Posts |
Posted - 2012-09-04 : 03:47:19
|
Thanks for your advice! |
 |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-09-05 : 21:50:29
|
np------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|