SELECT
REPLACE(MAX(SYS_CONNECT_BY_PATH(CASE WHEN A.RNVL >= B.NUM THEN '▒ ' ELSE ' -- ' END,'$')),'$','') GRAPH
FROM (
SELECT
ROWNUM SEQ,
ROUND(DBMS_RANDOM.VALUE(0,:RANDOM_VALUE)) RNVL
FROM ALL_OBJECTS
WHERE ROWNUM <= :RANDOM_VALUE
) A,
(SELECT ROWNUM NUM FROM ALL_OBJECTS WHERE ROWNUM <= :RANDOM_VALUE) B
START WITH A.SEQ = 1
CONNECT BY PRIOR A.SEQ = A.SEQ - 1
AND PRIOR B.NUM = B.NUM
GROUP BY B.NUM
ORDER BY B.NUM DESC
댓글등록
SQL문을 포맷에 맞게(깔끔하게) 등록하려면 code() 버튼을 클릭하여 작성 하시면 됩니다.