如果是10G的 select WMSYS.WM_CONCAT(file1) file1 from ( select 1 a,file1 ) group by a
10G以下SELECT SUBSTR (MAX (SYS_CONNECT_BY_PATH (file1, ',')), 2) file1 FROM (SELECT a.*, ROW_NUMBER () OVER (PARTITION BY a ORDER BY file1) rn FROM ( select 1 a,file1 from a ) a) GROUP BY a START WITH rn = 1 CONNECT BY rn - 1 = PRIOR rn AND a = PRIOR a
如果是10G的 select WMSYS.WM_CONCAT(file1) file1 from ( select 1 a,file1 from a ) group by a
受教了。 自己写的: select max(t.str) from (select ltrim(sys_connect_by_path(a.FILE1 , ','),',') str, a.num num1 from (select FILE1 , row_number() over(order by FILE1 desc) num from A) a start with a.num = (select count(1) from A) connect by prior a.num - 1 = a.num) t
select WMSYS.WM_CONCAT(file1) file1
from
(
select 1 a,file1
)
group by a
FROM (SELECT a.*, ROW_NUMBER () OVER (PARTITION BY a ORDER BY file1) rn
FROM (
select 1 a,file1
from a
) a)
GROUP BY a
START WITH rn = 1
CONNECT BY rn - 1 = PRIOR rn AND a = PRIOR a
select WMSYS.WM_CONCAT(file1) file1
from
(
select 1 a,file1
from a
)
group by a
自己写的:
select max(t.str)
from (select ltrim(sys_connect_by_path(a.FILE1 , ','),',') str, a.num num1
from (select FILE1 , row_number() over(order by FILE1 desc) num from A) a
start with a.num = (select count(1) from A)
connect by prior a.num - 1 = a.num) t
FROM A