1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| with Test_nm AS
(
select level as lvl, round(dbms_random.value(1, 1000), 5) as nm, round(dbms_random.value(1, 3)) as nb
from dual
connect by level <= 10
)
select lvl, nm, nb, to_char(nm, 'FM999D' || case nb when 1 then '9' when 2 then '99' when 3 then '999' end) as nm_char
from Test_nm;
LVL NM NB NM_CHAR
1 110.3196 2 110,32
2 864.80176 2 864,8
3 159.15888 3 159,159
4 95.15295 1 95,2
5 493.41549 2 493,42
6 708.08456 2 708,08
7 336.03994 2 336,04
8 587.04549 1 587,
9 673.23854 3 673,239
10 620.45914 1 620,5 |
Partager