Created on 07-13-2018 05:35 AM - edited 09-16-2022 06:27 AM
How to convert hh:mm:ss format to seconds in impala?
Eg: I have a string column as 00:01:30 (hh:mm:ss), I want it to convert to seconds as 90
Created on 07-14-2018 03:50 AM - edited 07-14-2018 03:52 AM
Hi @AkhilDTry with this indirect method:
SELECT split_part(input, ':', 1)*3600 + split_part(input, ':', 2)*60 + split_part(input, ':', 3) FROM your_table;
Good luck.