表 A 字段 col 如 select col from A 结果集为 春
夏
秋
冬我如何转成 结果集 为 4列的
春 春,夏 春,夏,秋 春,夏,秋,冬
求 高手指点下小弟在此谢过!!!
夏
秋
冬我如何转成 结果集 为 4列的
春 春,夏 春,夏,秋 春,夏,秋,冬
求 高手指点下小弟在此谢过!!!
解决方案 »
- 创建数据库时没有选择安装example,过后怎么安装它?
- 求oracle中国用户组论坛邀请码
- 请帮忙看看这两个query为啥返回结果不一样(outer join)?
- 各位帮忙啊,我如何用TOAD工具完整的备份数据库呢,我没有找到,,难道ORA的备份真的不如MSSQL方便吗?
- 能否同时安装oracle7.3 和oracle9客户端,急!!!!!
- 送分!关于工具——SQL Navigator !!!!
- ORACLE中报:maximum number of processes (50) exceeded
- 关于client端与server端的连接问题
- === 菜鸟求助 ===
- oracle初学问题:为什么我在svrmgrl中shutdown了数据库,但在服务里还看到OracleServiceYYYD和OracleServiceHXMASTER是启动的?
- 关于index的问题
- SQL Developer英文版,新手求助
SQL> create table a(col varchar2(3));
SQL> insert into a select '春' from dual;
SQL> insert into a select '夏' from dual;
SQL> insert into a select '秋' from dual;
SQL> insert into a select '冬' from dual;
SQL> select regexp_substr(wm_concat(col),'[^,]+') col1,
2 regexp_substr(wm_concat(col),'[^,]+[,]+[^,]+') col2,
3 regexp_substr(wm_concat(col),'[^,]+[,]+[^,]+[,]+[^,]+') col3,
4 wm_concat(col) col4 from a;COL1 COL2 COL3 COL4
---------- ---------- ---------- ---------------
春 春,夏 春,夏,秋 春,夏,秋,冬
max(decode(rn, 2, col)) col2,
max(decode(rn, 3, col)) col3,
max(decode(rn, 4, col)) col4 from (
select wm_concat(col) over (order by rownum) col, rownum rn from a);