PersonID
DateTime
Temperature
Pressure
2. I want to build a view into this table so that it shows up as follows:
PersonID DateTime1 DateTime2 DateTime3 .....
1 Pressure1 Pressure2 Pressure3 ......
1 Temperature1 Temperature2 Tempearture3 .....
2 :
:
how would I do this?
Hello,
Your resultset seems to contain and thus represent two disparate data sets (one of Pressure and one of Temperature). Why would you want to do this when there would be no way to determine what is pressure and what is temperature?
Regardless, you would use the new PIVOT operator, and if you did want to include two data sets, you would need to union the results of two separate pivots in your view. BOL has some good examples of using PIVOT.
Cheers,
Rob
|||Thanks for responding!I will construct 2 separate views - one for temperarure and one for pressure.
But I am confused as to how to do it for even just temperature.
Is there a way of doing this without Pivot? I am using SQL 2000|||
Hello,
Have a look at http://dotnetjunkies.com/WebLog/thomasswilliams/archive/2005/10/23/133383.aspx for starters. The actual solution will depend upon your data.
Cheers,
Rob
No comments:
Post a Comment