INTERVAL includes two datatypes that allow you to set appropriate durations more precisely : INTERVAL « PL SQL Data Types « Oracle PL/SQL Tutorial






declare
    variable1_int INTERVAL YEAR[(precision)] TO MONTH;
begin
    NULL;
end;

The INTERVAL YEAR TO MONTH datatype allows you to store and manipulate intervals of years and months.

You can specify the number of digits in years that you want to store (by default 2, available range is 0?).

INTERVAL DAY

declare
    variable2_int INTERVAL DAY[(precision)] to SECOND[(precision)];
begin
    NULL;
end;

The INTERVAL DAY TO SECOND datatype allows you to store and manipulate intervals of days, hours, minutes, and seconds.

In this case, day precision allows you to set the number of digits you want to store, and second precision identifies the number of digits used to store fractions of seconds.









21.8.INTERVAL
21.8.1.INTERVAL includes two datatypes that allow you to set appropriate durations more precisely
21.8.2.Interval value expressions
21.8.3.DAY TO SECOND examples
21.8.4.workarounds for defining intervals
21.8.5.Add some years and months
21.8.6.Add some days, hours, minutes, and seconds
21.8.7.Add 1 year, 2 months, 3 days, 4 hours, 5 minutes, 6.7 seconds
21.8.8.Adding and subtracting intervals
21.8.9.Interval multiplication
21.8.10.length of service for INTERVAL YEAR TO MONTH
21.8.11.Show some interval division
21.8.12.Storing elapsed time with INTERVAL DAY TO SECOND
21.8.13.Use INTERVAL types
21.8.14.Add date interval to timestamp
21.8.15.Double the interval