有一张表table1如下
id Oid
1 02
1 03
1 05
2 03
2 07
合成table2
id Oid
1 02,03,05
2 03,07
表的数据是会变动的,不能用存储过程和函数,可以用视图实现
id Oid
1 02
1 03
1 05
2 03
2 07
合成table2
id Oid
1 02,03,05
2 03,07
表的数据是会变动的,不能用存储过程和函数,可以用视图实现
解决方案 »
- oracle9.2恢复出错
- CentOS5.4安装Oracle10g 出现乱码
- 怎么算出自然周
- 高分寻问ORACLE生成DBF
- 帮忙弄个查询语句,有点困难
- Oracle中用函数怎么生成一个含有1000条随机数据的记录的表!
- PL/SQL问题
- oracle10g企业管理工具怎么打不开
- Linux下安装oracle-xe,密码不对,用silent方式装的,密码绝对不会输错。
- 请教一下,oracle数据库,字段date用字符串来表示日期时间:2007-10-10 10:10:10想找出date的值为当前日期,如列出date为2007-11-29号的记录的select语句怎样写
- ORACLE 动态的行列转换语句~~100求救
- 怎样实现Oracle实时复制数据到远程Access?
from table1
group by id
select id,substr(max(sys_connect_by_path(oid,',')),2) oid
from
(
select a.*,row_number () over(partition by id order by oid) rn
from table1
)
group by id
start with rn=1
connect by rn-1=prior rn and id=prior id
我也是第一次碰到这样的问题,以前没碰到过~!~!
请问WMSYS.WM_CONCAT 这个是什么啊,请大哥讲讲:-)认真学习
还有select a.* 会报a不存在,是怎么回事呀~!~!(*^__^*) 嘻嘻……
select a.* 报错
是因为
select a.*,row_number () over(partition by id order by oid) rn
from table1
后面的table1忘记写别名了
应该是select a.*,row_number () over(partition by id order by oid) rn
from table1 a
不是专门oracle开发的
这么深的sql还是头一会写:-(
还得多多的学习啊