Reputation: 11
What is the best way to convert a row with columns to a list with rows? In the list, I need one column with the old column name and one column with the old column value.
For Example:
Current:
PersonId | PersonFirstName | PersonLastName |
Need:
ColumnName | ColumnValue
Hope this makes sense. Thanks for any help.
Upvotes: 1
Views: 1571
Reputation: 16032
You need to use Pivot clause. You can see this question for some examples.
Upvotes: 4