I have duration field in my redshift table as defined as varchar field and the data is in the below formate (hours:minutes:seconds:microseconds):
Example:
| Duration |
|---|
| 00:00:02.696000 |
| 00:04:04 |
| 00:01:04.127000 |
| 04:03:02.063000 |
| 00:03:08.300000 |
| 00:05:05 |
| 00:01:00.150000 |
| 32:01:03.200000 |
I would need find out the total duration. Some durations are more than 24 hours
Do we have any SQL that we can calculate the total duration in hours:minutes:seconds:microseconds ?
In above case the total is approx. --> 36:18:28 which is 36 hours and 18 minutes and 28 seconds and some micro seconds.