Convert Seconds to HH:MM:SS in teradata

孤人 提交于 2019-12-24 08:17:19

问题


I have a decimal(6,2) field storing data in seconds.

I want those seconds to be converted in to HH:MM:SS.

For ex: '19,500' seconds should be shown as 05:25:00


回答1:


Assuming that the datatype is a typo (you can't store 19500 in a decimal(6,2)):

col * INTERVAL '00:00:01' HOUR TO SECOND    -- no fractional seconds

col * INTERVAL '00:00:01.00' HOUR TO SECOND -- fractional seconds


来源:https://stackoverflow.com/questions/38521268/convert-seconds-to-hhmmss-in-teradata

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!