我试图找出如何将具有存储国家字符变化HH:MM:SS的字段转换为一个字段的分钟,以及另一个字段的秒。
感谢您的帮助!
答案 0 :(得分:0)
试试这个。
select cast(sub.timestring as time) as timeval
,extract(hours from cast(sub.timestring as time)) as hours
,extract(minutes from cast(sub.timestring as time)) as minutes
,extract(seconds from cast(sub.timestring as time)) as seconds
,extract(epoch from cast(sub.timestring as time)) as totalTimeValueInSeconds
from (select '02:31:12' as timestring) sub