Say I have a table with a number of columns that is unknown to me, but only a single row:
A B C D E F G...n
1 2 3 4 5 6 7...x
And I would like to pivot it into a table of LABEL:VALUE pairs:
LABEL VALUE
A 1
B 2
C 3
... ...
n x
This seems like it should be a regular pivot (I think...sorry, a bit of a n00b to SQL), but don't I need to know the names of the columns that I wish to pivot, preventing me from pivoting an unknown number of columns? Is there a simple way to accomplish this?
xQbert: That does look close! Thank you, I didn't see that one when I was searching to post this question. I'll check it out! – Kenneth Tomplait Feb 26 '15 at 21:50