You can use a correlated hierarchical query:
SELECT t.id, r.COLUMN_VALUE, t.cnt
FROM table_name t
CROSS JOIN
TABLE(
CAST(
MULTISET(
SELECT LEVEL
FROM DUAL
CONNECT BY LEVEL <= t.cnt
)
AS SYS.ODCINUMBERLIST
)
) r;
or a recursive sub-query factoring clause:
WITH row_generator ( id, lvl, cnt ) AS (
SELECT id, 1, cnt
FROM table_name
UNION ALL
SELECT id, lvl + 1, cnt
FROM row_generator
WHERE lvl < cnt
)
SELECT *
FROM row_generator
ORDER BY id, lvl
So for the test data:
CREATE TABLE table_name ( ID, cnt ) AS
SELECT 'A', 12 FROM DUAL UNION ALL
SELECT 'B', 138 FROM DUAL
Both these solutions would output:
ID | COLUMN_VALUE | CNT
:- | -----------: | --:
A | 1 | 12
A | 2 | 12
A | 3 | 12
...
A | 10 | 12
A | 11 | 12
A | 12 | 12
B | 1 | 138
B | 2 | 138
B | 3 | 138
B | 4 | 138
...
B | 136 | 138
B | 137 | 138
B | 138 | 138
db<>fiddle here