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 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
|
SQL> set autot traceonly statistics
SQL> select case (select count(*) from dba_objects a cross join dba_objects b)
2 when 1 then 1 when 2 then 1
3 when 4 then 2 when 5 then 2
4 when 10 then 3 when 20 then 3
5 when 30 then 4 when 60 then 4
6 when 1000 then 5 when 20000 then 5
7 else 0
8 end
9 from dual;
Statistics
----------------------------------------------------------
14 recursive calls
0 db block gets
137199131 consistent gets
0 physical reads
0 redo size
573 bytes sent via SQL*Net to client
499 bytes received via SQL*Net from client
2 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
1 rows processed
SQL> select case when (select count(*) from dba_objects a cross join dba_objects b) in (1, 2) then 1
2 when (select count(*) from dba_objects a cross join dba_objects b) in(4, 5) then 2
3 when (select count(*) from dba_objects a cross join dba_objects b) in(10, 20) then 3
4 when (select count(*) from dba_objects a cross join dba_objects b) in(30, 60) then 4
5 when (select count(*) from dba_objects a cross join dba_objects b) in(1000, 20000) then 5
6 else 0
7 end
8 from dual;
Statistics
----------------------------------------------------------
70 recursive calls
0 db block gets
685995645 consistent gets
30 physical reads
0 redo size
654 bytes sent via SQL*Net to client
499 bytes received via SQL*Net from client
2 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
1 rows processed |