I have the following output in the request.
SKILL LEVEL SCORERANGE
-----------------------------------------------------------------------------
Stunts LOW 0.0 - 4.0
Stunts MED 3.0 - 7.0
Stunts HI 6.0 - 10.0
Pyramids LOW 0.0 - 4.0
Pyramids MED 3.0 - 7.0
Pyramids HI 6.0 - 10.0
Tosses LOW 0.0 - 4.0
Tosses MED 3.0 - 7.0
Tosses HI 6.0 - 10.0
Standing Tumbling LOW 0.0 - 4.0
Standing Tumbling MED 3.0 - 7.0
Standing Tumbling HI 6.0 - 10.0
Running Tumbling LOW 0.0 - 4.0
Running Tumbling MED 3.0 - 7.0
Running Tumbling HI 6.0 - 10.0
Jumps LOW 0.0 - 4.0
Jumps MED 3.0 - 7.0
I want to PIVOT this data without aggregating anything. So I want the result to show only one row for each skill and rotate LEVEL, something like this ...
SKILL LOWRANGE MEDRANGE HIRANGE
Stunts 0.0 - 4.0 3.0 - 7.0 6.0 - 10.0
Pyramids 0.0 - 4.0 3.0 - 7.0 6.0 - 10.0
Tosses 0.0 - 4.0 3.0 - 7.0 6.0 - 10.0
Standing Tumbling 0.0 - 4.0 3.0 - 7.0 6.0 - 10.0
Running Tumbling 0.0 - 4.0 3.0 - 7.0 6.0 - 10.0
...
I have a pretty good understanding of the basic pivot syntax, but I'm struggling with this because the result set has nothing to do with it.
To give you something to try to fix for me ...
SELECT SKILL, LOWRANGE, MEDRANGE, HIRANGE
FROM (SELECT SKILL, [LEVEL], SCORERANGE FROM ScoreRanges) ps
PIVOT
(
MAX(SCORERANGE)
FOR SCORERANGE IN
(
)
) as pvt
Thank you for your help.
Set
source
share