This is how I understood it (with some sample data and step-by-step calculation; you'd use result
only).
SQL> with test (id, date_from, date_to) as
2 (select 1, to_date('08.03.2023 17:00', 'dd.mm.yyyy hh24:mi'), to_date('08.03.2023 20:25', 'dd.mm.yyyy hh24:mi') from dual union all
3 select 2, to_date('08.03.2023 17:00', 'dd.mm.yyyy hh24:mi'), to_date('08.03.2023 20:42', 'dd.mm.yyyy hh24:mi') from dual union all
4 select 3, to_date('08.03.2023 17:00', 'dd.mm.yyyy hh24:mi'), to_date('08.03.2023 20:06', 'dd.mm.yyyy hh24:mi') from dual union all
5 select 4, to_date('08.03.2023 17:00', 'dd.mm.yyyy hh24:mi'), to_date('08.03.2023 20:57', 'dd.mm.yyyy hh24:mi') from dual
6 ),
Query:
7 temp as
8 (select id, date_from, date_to,
9 numtodsinterval(date_to - date_from, 'day') diff
10 from test
11 )
12 select id,
13 to_char(date_from, 'hh24:mi') date_from,
14 to_char(date_to , 'hh24:mi') date_to,
15 --
16 diff,
17 extract(hour from diff) hh,
18 extract(minute from diff) mi,
19 --
20 case when extract(minute from diff) between 15 and 22 then 0.25
21 when extract(minute from diff) between 23 and 37 then 0.50
22 when extract(minute from diff) between 38 and 52 then 0.75
23 when extract(minute from diff) < 14 then 0.00
24 when extract(minute from diff) > 52 then 1.00
25 end rnd,
26 --
27 extract(hour from diff) +
28 case when extract(minute from diff) between 15 and 22 then 0.25
29 when extract(minute from diff) between 23 and 37 then 0.50
30 when extract(minute from diff) between 38 and 52 then 0.75
31 when extract(minute from diff) < 14 then 0.00
32 when extract(minute from diff) > 52 then 1.00
33 end result
34 from temp
35 order by id;
ID DATE_FROM DATE_TO DIFF HH MI RND RESULT
--- ---------- ---------- ------------------------------ --- --- ----- ----------
1 17:00 20:25 +000000000 03:25:00.000000000 3 25 0,50 3,5
2 17:00 20:42 +000000000 03:42:00.000000000 3 42 0,75 3,75
3 17:00 20:06 +000000000 03:06:00.000000000 3 6 0,00 3
4 17:00 20:57 +000000000 03:57:00.000000000 3 57 1,00 4
SQL>