开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜