表名 test
其中test_a1,test_a2,test_a3字段名
test_a1 test_a12 test_a3
ss dd ff
sss ddd fff
s b v
s g h
s y
用一条sql使结果显示为
test_a1 test_a12 test_a3
ss dd ff
sss ddd fff
s b,g,t v,h,y
求一条sql语句?????
...全文
2006打赏收藏
急急急急急!!求一条sql语句????
表名 test 其中test_a1,test_a2,test_a3字段名 test_a1test_a12 test_a3 ss dd ff sss ddd fff s b v s g h s y 用一条sql使结果显示为 test_a1test_a12 test_a3 ss dd ff sss ddd fff s b,g,t v,h,y 求一条sql语句?????
select max(substr((sys_connect_by_path(name,',')),2)) cola
from (
select id,name,
rownum rnum,
row_number() over(partition by id order by id) rn1
from a
)
start with rn1=1
connect by rnum-1=prior rnum
group by id
;