SELECT deptno,
REGEXP_SUBSTR(VAL, '[^|]+', 1, 1) as PART1,
REGEXP_SUBSTR(VAL, '[^|]+', 1, 2) as PART2,
REGEXP_SUBSTR(VAL, '[^|]+', 1, 3) as PART3,
REGEXP_SUBSTR(VAL, '[^|]+', 1, 4) as PART4,
REGEXP_SUBSTR(VAL, '[^|]+', 1, 5) as PART5,
REGEXP_SUBSTR(VAL, '[^|]+', 1, 6) as PART6
from (SELECT DEPTNO, LISTAGG(ENAME,'|') WITHIN GROUP (ORDER BY DEPTNO) val
FROM EMP
GROUP BY DEPTNO);