J'ai essayé la requête suivante et obtenu le résultat souhaité.
SELECT
LISTAGG(X, ',') WITHIN GROUP(
ORDER BY
X
) as result
FROM
(
SELECT
X,
SUM(LENGTH(X)) OVER(
ORDER BY
X
) LENGTH_X,
COUNT(1) OVER(
ORDER BY
X
) - 1 AS COMMAS
FROM
(
SELECT
LEVEL X
FROM
DUAL
CONNECT BY
LEVEL <= 20
)
)
GROUP BY
CEIL((LENGTH_X + COMMAS) / 15);
Sortie :
Bravo !