标签: sql hive
如何获取timestamp和2015-09-11 10:04:31之类的2015-09-11 10:04:55的时间间隔?
timestamp
2015-09-11 10:04:31
2015-09-11 10:04:55
答案 0 :(得分:1)
使用init:
init
unix_timestamp
这将返回SELECT (unix_timestamp('2015-09-11 10:04:55') - unix_timestamp('2015-09-11 10:04:31')) 中的差异。如果要将其转换为分钟数,请除以60。
SELECT (unix_timestamp('2015-09-11 10:04:55') - unix_timestamp('2015-09-11 10:04:31'))