In SQL, multiplying an INTERVAL by a NUMBER produces another INTERVAL. Is there an inverse operation that takes two INTERVALs, and produces a NUMBER, the ratio of the two intervals?
That is, instead of
DECLARE
x INTERVAL DAY TO SECOND;
y INTERVAL DAY TO SECOND;
n NUMBER;
BEGIN
x := INTERVAL '1' MINUTE;
n := 1.5;
y := x * n;
dbms_output.put_line (y || ' = y');
END;
where I compute y from the values I gave to x and n, how can I compute n from values I give to x and y? Is there an inverse function to NUMTODSINTERVAL in Oracle 18.4.0.0.0?