Something like this perhaps...
for example...Code:SELECT n, TRUNC (DBMS_RANDOM.VALUE (0, n)) m FROM (SELECT TRUNC (DBMS_RANDOM.VALUE (1, 7)) n FROM {your_row_source_here})
Code:Personal Oracle Database 10g Release 10.1.0.2.0 - Production With the Partitioning, OLAP and Data Mining options SQL> SELECT n, TRUNC (DBMS_RANDOM.VALUE (0, n)) m 2 FROM (SELECT TRUNC (DBMS_RANDOM.VALUE (1, 7)) n 3 FROM dual 4 MODEL DIMENSION BY (0 x) MEASURES (0 y) 5 RULES ITERATE (10) (y [iteration_number] = 0)); N M ---------- ---------- 4 3 2 0 3 0 1 0 3 2 2 1 2 1 4 3 3 0 3 1 10 rows selected. SQL>




Reply With Quote