I have 'duration' datas stored as varchar(4) in a table.
2 first characters are
hours, 2 last characters are
0100 means 01:00 0456 means 04:56
and so on...
- What I need:
I have to make a query that retrieve this field as a common time format :
- What I have tried:
No real clue at the moment. I tried to cast my value as
interval, but it doesn't behave as expected
> SELECT time_field, time_field::interval FROM myTable... > OUTPUT: 0100 | 01:40 0120 | 02:00 0179 | 02:59
I would like to avoid use of substring to add
':' in between 2 characters pairs.
Any help appreciated. Thanks.