I want to obtain the diference between to timestamp fields
Timestamp field 1: '12:49:00'
Timestamp Field 2: '12:51:15'
Result must be: '00:02:15' (the time elapsed between the field1 and field2)
How can obtain this result?
Thanks in advance for your support.
You can use the following query:
SEL TIME '12:51:00' - INTERVAL '12:49:15' HOUR TO SECOND;
When you substract 2 timestamps the result is an INTERVAL:
select (timestamp2 - timestamp1) day(4) to second
Caution: this will fail if the difference is >= 10000 days (27 years)