MINUTES_BETWEEN
Purpose
This function returns the number of minutes between two timestamps timestamp1 and timestamp2.
Syntax
minutes_between::=
Usage Notes
- If the first timestamp
timestamp1is earlier than the second timestamptimestamp2, then the result is negative. - For data type
TIMESTAMP WITH LOCAL TIME ZONEthis function is calculated internally within UTC.
Example
SELECT MINUTES_BETWEEN(TIMESTAMP '2000-01-01 12:01:00',
TIMESTAMP '2000-01-01 12:00:02') MINUTES;