oracle 视图sql语句怎么写
现有表1列a列b1a2b1c2d创建视图成列a列b列c1ac2bdsql怎么写啊多谢图片...
现有表1
列a 列b
1 a
2 b
1 c
2 d
创建视图成
列a 列b 列c
1 a c
2 b d
sql怎么写啊
多谢
图片 展开
列a 列b
1 a
2 b
1 c
2 d
创建视图成
列a 列b 列c
1 a c
2 b d
sql怎么写啊
多谢
图片 展开
展开全部
select 列a, ltrim(max(sys_connect_by_path(列b,',')),',') 列b
from (select 列a,privname,seq,lag(seq) over(partition by 列a order by seq) seq_new
from ( select 列a,列b, row_number() over(order by 列a) seq
from 表1
)
)
start with seq_new is null
connect by prior seq = seq_new
group by 列a;
from (select 列a,privname,seq,lag(seq) over(partition by 列a order by seq) seq_new
from ( select 列a,列b, row_number() over(order by 列a) seq
from 表1
)
)
start with seq_new is null
connect by prior seq = seq_new
group by 列a;
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询