Problem: You have two columns of the type timestamp and you want to calculate the difference between them.
Example: In the travel table, there are three columns: id, departure, and arrival. You'd like to calculate the difference between the arrival and the departure.
The travel table looks like this:
iddeparturearrival 12018-03-25 12:00:002018-04-05 07:30:00 22019-09-12 15:50:002019-10-23 10:30:30 32018-07-14 16:15:002018-07-14 20:40:30 42018-01-05 08:35:002019-01-08 14:00:00 Solution 1 (difference in days, hours, minutes, and seconds): SELECT id, departure, arrival, arrival - departure AS difference FROM travel; The result is:
wono
|
|
wono
Postgresql difference between two timestamps
https://sqlserverguides.com/postgresql-difference-between-two-timestamps/
Do you want to delete?