brucegonewild
Programmer
hey there,
I need to turn this following table:
into:
Naturally, I would have to use "PIVOT". Except, when using the pivot functionality I have to statically include the values that will turn into the col-header. My problem is, these rows that are being pivoted, are dynamic!! I have no way of knowing what they are and therefore
Pivot (Max(Col1) for Col2 in ([r12], [r22]) will not work. I tried putting a Select * inside the "IN" section... that didn't work...
Your help is much apreciated
I need to turn this following table:
Code:
Col1 |Col2 |Col3
-----|-----|----
r11 |row12|row13
-----|-----|----
r21 |row22|row23
-----|-----|----
into:
Code:
Col1 | r12 | r22
-----|-----|----
Naturally, I would have to use "PIVOT". Except, when using the pivot functionality I have to statically include the values that will turn into the col-header. My problem is, these rows that are being pivoted, are dynamic!! I have no way of knowing what they are and therefore
Pivot (Max(Col1) for Col2 in ([r12], [r22]) will not work. I tried putting a Select * inside the "IN" section... that didn't work...
Your help is much apreciated