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 |
|
djorre
Yak Posting Veteran
94 Posts |
Posted - 2009-05-13 : 08:47:27
|
| Hi friends,Im learning how to cross tab.Used something like thisSelect Recipe, Case When DescriptAPI='ACTION_OVER_RANGE' THEN PValueAPI + ' ' + EU ELSE null END as ACTION_OVER_RANGE,Case When DescriptAPI='ACTION_UNDER_RANGE' THEN PValueAPI + ' ' + EU ELSE null END as ACTION_UNDER_RANGE,Then I get a table full off nulls, which has to be grouped, which is no problem because every column contains only 1 value per ID.So I already have a query like thisRecipe - Sensor 1 - Sensor 2 - Sensor 31 NULL NULL 51 5 NULL NULL1 NULL NULL NULL2 NULL NULL NULL2 1 NULL NULL2 NULL 7 NULL2 NULL NULL NULL4 7 NULL NULL4 NULL NULL 3It most become in this form:Recipe - Sensor1 - Sensor2 - Sensor31 5 NULL 52 1 7 NULL4 7 NULL 3How to do this? Please help. |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2009-05-13 : 08:57:42
|
Put max( case ... end )...group by reciepe E 12°55'05.63"N 56°04'39.26" |
 |
|
|
djorre
Yak Posting Veteran
94 Posts |
Posted - 2009-05-13 : 09:00:11
|
| Thank you SO much for that super fast respons!I love this forum |
 |
|
|
|
|
|