1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
select
tmp1.col1,
tmp1.col2,
(case when tmp2.R1 = 1 then 'toto'
when tmp2.R1 = 2 then 'titi'
when tmp2.R1 = 3 then 'tutu'
when tmp2.R1 = 4 then 'bobo'
when tmp2.R1 = 5 then 'bibi'
when tmp2.R1 = 6 then 'bubu'
else 'blabla' end),
tmp1.col4
FROM
(
select
rownum as NUM,
t1.col1 as col1,
t2.col2 as col2,
t1.col4 as col4
from t1,t2
) tmp1
inner join
(
select
rownum as NUM,
trunc(dbms_random.value(1,6),0) as R1
from dual
connect by rownum <= 50 --ici mettre le nombre de ligne que l on a en restitution par exemple ici 50
) tmp2
ON tmp1.NUM = t2.NUM |
Partager