Count the unit boundaries crossed between two datetimes with
DATEDIFF ( <unit>, <dt1>, <dt2> )
Note it's the boundaries crossed, not the duration
e.g. 31-Dec-2025 to 2-Jan-2026 crosses the 1st Jan boundary
=> the year diff = 1
Added to Oracle SQL in 23.26.1
2 months ago