I have a table in a database with rows as follows:
Milk
Eggs
Butter
Cheese
Bread
I want to pivot the entire row into a column appears as follows:
Milk Eggs Butter Cheese Bread
I have found a lot of examples using it with multiple columns and rows or based on select conditions. I haven’t found any examples of how to just do one row, and I can’t figure it out. Thanks for the help!
Edit:
The ways below work great but is there a way to do it and turn the row value into a column value?
Using a modified version of the sample here.
P.S. I’d have to seriously question why I was doing this. 🙂