列到行 [英] Columns to Rows

查看:120
本文介绍了列到行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有下面一行的表
说明
A; B

我需要生成该格式的返回o/p的查询
说明
A
B

I have a table of the following row
Description
A;B

I need to generate a query of that return o/p of format
Description
A
B

推荐答案

此功能称为转置,可以通过数据透视表完成.

http://social.msdn.microsoft.com/论坛/en-US/sqlgetstarted/thread/93b04f26-8e52-46ce-adb8-7b5fb9dfdb53 [ http://msdn.microsoft.com/en-us/library/ms177410.aspx [ ^ ]

祝你好运!
This functionality is called transpose and can be done with a pivot table.

http://social.msdn.microsoft.com/forums/en-US/sqlgetstarted/thread/93b04f26-8e52-46ce-adb8-7b5fb9dfdb53[^]

http://msdn.microsoft.com/en-us/library/ms177410.aspx[^]

Good luck!


通过下面的链接


Go through the below link


Pivot in sqlserver[^]


请使用Rajesh提供的链接埔里

我们也可以通过临时表来执行此操作,但是如果使用的是SQL Server,则应使用SQL Server的功能
Please use link given by Rajesh Puli.

We can do this by temp table as well, but if we are using SQL Server then we should use the Features of SQL server


这篇关于列到行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆