August 25, 2008 at 12:26 pm
Looking for techniques people use for pivoting data. I have done pivoting various ways in the past like subselects, pivot command, etc.. but I am trying to see how other people do this as I am struggling with some performance issues.
My scenario.
26 columns.
Column 1 = ID
The remaining 25 columns are sets of 5 duplicates. For example Type1Price, Type2Price, Type3Price, Type1Amount, Type2Price, Type3Price....etc. This query does not need to be dynamic, and the Type Description can be hard coded.
I want the results as follows
ID, Type, Price, Amount
1, "Type A Desc", 5.99, 100
2, "Type B Desc", 2.09, 99
August 25, 2008 at 1:40 pm
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply