大数据之Hive:Hive 计算两个时间相差的分钟
目录1.Hive 计算两个时间相差的分钟1.Hive 计算两个时间相差的分钟selectfloor((unix_timestamp('2017-05-20 08:35:22','yyyy-MM-dd HH:mm:ss')- unix_timestamp('2017-05-20 08:34:21','yyyy-MM-dd HH:mm:ss'))/60)checktime ;checktime1sel
·
1.Hive 计算两个时间相差的分钟
select floor((unix_timestamp('2017-05-20 08:35:22','yyyy-MM-dd HH:mm:ss')- unix_timestamp('2017-05-20 08:34:21','yyyy-MM-dd HH:mm:ss'))/60) checktime ;
checktime
1
select (unix_timestamp("2017-01-19 00:00:00") - unix_timestamp(substr("2017-01-18 23:59:55.511" ,1,19)))/60 checktime ;
checktime
0.08333333333333333
更多推荐
已为社区贡献1条内容
所有评论(0)