oracle 怎样写sql语句 将同一个ID关联的多个外键用逗号连接成一条数据。

2025年05月09日 06:19
有3个网友回答
网友(1):

赞个毛,1楼语法错误,Oracle不支持as写法,应该是 字段名 新名字

网友(2):

回答者: badkano - 十四级 2010-9-6 11:07
------------------------------
赞!!!

网友(3):

select id,ltrim(sys_connect_by_path(xh,','),',') as xh from (select id,xh,count(*) over(partition by id) cnt from 表名) where level=cnt connect by prior id=id and prior ascii(xh)