SQL Table Row Convert to List of Columns
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.开发者_C百科
You need to use Pivot clause. You can see this question for some examples.
精彩评论