Reputation: 29
I have two fields in table like
Time1(varchar) Time2(varchar)
13:01:15 14:02:06
How do I get the time difference between these two fields?
Upvotes: 0
Views: 214
Reputation:
You can cast the values to a proper time value, then simply subtract them:
'14:02:06'::time - '13:01:15'::time
or
time_2::time - time_1::time
The result is an interval
Upvotes: 1