首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >转换列中行的查询

转换列中行的查询
EN

Stack Overflow用户
提问于 2011-06-23 13:24:29
回答 1查看 237关注 0票数 1

我想将行转换为列。IE:接受以下内容:

代码语言:javascript
运行
复制
HOPPER_CLOSE_TIME     HOPPER_OPEN_TIME     SR_NO    CAL_DONE  PARTIAL_CALC_DONE_TIME
------------------------------------------------------------------------------------
23-06-2011 10:26:41   23-06-2011 10:29:23  535100   2         23-06-2011 10:28:41

我想用这种方式

代码语言:javascript
运行
复制
HOPPER_CLOSE_TIME         23-06-2011 10:26:41
HOPPER_OPEN_TIME          23-06-2011 10:29:23
SR_NO                     535100
CAL_DONE                  2
PARTIAL_CALC_DONE_TIME    23-06-2011 10:28:41
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2011-06-23 15:17:11

代码语言:javascript
运行
复制
select HOPPER_CLOSE_TIME  new_column_name from table1 where your_condition_here
union all
select  HOPPER_OPEN_TIME  new_column_name from table1 where your_condition_here
union all
select  SR_NO             new_column_name from table1 where your_condition_here
union all
select CAL_DONE           new_column_name from table1 where your_conidtion_here
union all
selectnPARTIAL_CALC_DONE_TIME new_column_name from table1 where your_condition_here
票数 -1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/6449694

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档