I wish to get several random numbers in a range but without duplicates. To do so I could use recursive cte generator as follows:
WITH rand_cte (cnt, value) AS
(
SELECT
1,
ROUND(dbms_random.value(1,20))
FROM dual
UNION ALL
SELECT
cnt + 1,
ROUND(dbms_random.value(1,20))
FROM rand_cte
WHERE cnt < 5
)
SELECT value
FROM rand_cte;
But such a solution will include duplicates as well. Any ideas how to filter them out in some way? Maybe you know different solution?