id value
----------------------
a1 23
a2 56
a3 46
a4 13
a5 98
. .
. .
. .
. .
. .转换为
a1 a2 a3 a4..............
--------------------------
23 56 46 13..............这个查询怎么写,,,只用语句,,,不想用过程什么的!!!
----------------------
a1 23
a2 56
a3 46
a4 13
a5 98
. .
. .
. .
. .
. .转换为
a1 a2 a3 a4..............
--------------------------
23 56 46 13..............这个查询怎么写,,,只用语句,,,不想用过程什么的!!!
解决方案 »
- PL/SQL table看不到表,SELECT命令能找到,求解
- oracle 查询替换问题
- Io 异常: The Network Adapter could not establish the connection
- 急急急! 关于触发器的一个问题 在线等
- ORACLE中一个数据库是不是只能包含一个实例?
- ORA-01033: ORACLE initialization or shutdown in progress,shutdown abort>startup试过也不行。。。
- standby为什么要配置两个监听文件?
- 问个简单的问题,exp和Imp这两个命令在哪里执行呀
- 怎样解决?高分
- 在PROFESSION 2000下安装ORACLE9 遇到困难
- 小散点分,多了个小裤衩
- 放分中,关于频繁访问,速度很慢的问题。
10g试试下面的方法:
SELECT replace(WMSYS.WM_CONCAT(id),',',' ') FROM tablea
union
SELECT replace(WMSYS.WM_CONCAT(value),',',' ') FROM tablea;
case id when 'a1' then value end a1,
case id when 'a2' then value end a2,
case id when 'a3' then value end a3,
case id when 'a4' then value end a4,
case id when 'a5' then value end a5,
case id when 'a6' then value end a6,
case id when 'a7' then value end a7
from 表...
多行转列肯定要用到过程!
sum(decode(id,'a2',value,0))"a2",
.
.
.
.
from table;