本文介绍了使用Netezza以秒为单位的时差?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在秒钟内在Netezza中获得以分钟为单位的时差.

I want to Get time difference in minutes in Netezza in Seconds.

我有2列:Start(2014-06-01 07:45:04)finish(2014-06-01 07:46:58)事件

我尝试使用DATEDIFF(SECOND,start,finish),但是Netezza出现错误.

I have tried Using DATEDIFF(SECOND,start,finish), but Netezza shoots an error.

我缺少一个功能吗?

Select R.*,S.*,CM.URL,DATEDIFF(SECOND,R.EVENT_DTM,S.MIN) From CTE_1 R
JOIN CTE_2 S
on S.VISIT_KEY = R.VISIT_KEY
JOIN ADMIN.VW_DIM_CME_METADATA CM on CM.CONTENT_METADATA_KEY = R.CONTENT_METADATA_KEY

推荐答案

在IBM论坛上进行了一些搜索,发现这可行.如果有人提供更好的方法,请发布.谢谢

Did some Searching on the IBM forums and found this which works. If someone comes with better way please do post it. Thanks

    Select
    R.*,S.*,CM.URL,
    EXTRACT(EPOCH from S.MIN - R.EVENT_DTM)DIFF
    From CTE_1 R
    JOIN CTE_2 S
    on S.VISIT_KEY = R.VISIT_KEY
    JOIN ADMIN.VW_DIM_CME_METADATA CM on CM.CONTENT_METADATA_KEY = R.CONTENT_METADATA_KEY

这篇关于使用Netezza以秒为单位的时差?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-09 10:10