Matt_B
Well-Known Member
I have a table of one row (it's actually a view, don't ask why I have a table with only one row)
What I want to end up with, using SQL is
Col1, 12
Col2, 234
Col3, 25
Col4, 290
So turn 1 row into however many rows there are columns, with the single row value as the second column
I believe maybe cross join, cross apply or pivot tables may do this, but I can't for the life of me get it to work.
Code:
Col 1, Col 2, Col 3, Col 4
12, 234, 25, 290
What I want to end up with, using SQL is
Col1, 12
Col2, 234
Col3, 25
Col4, 290
So turn 1 row into however many rows there are columns, with the single row value as the second column
I believe maybe cross join, cross apply or pivot tables may do this, but I can't for the life of me get it to work.