0

我需要向 oracle 表发出选择语句,如下所示:

SELECT 
    T."Node" 
FROM 
    DW.KPX_PHYSICAL_MEMORY_DV T 
where 
    T."Node" like 'cigp%' 
    AND  CAST((FROM_TZ(CAST(GET_UTC_TIMESTAMP(T."Timestamp", TMZDIFF) AS TIMESTAMP),'+00:00') AT TIME ZONE 'US/Eastern') as DATETIME)>='04-Jun-13 10.46.46.00'

我得到无效的数据类型,我对 oracle 很陌生。有人可以告诉我我在这里做错了什么吗?

Timestamp 是 char 类型,其值如下所示:

1121004234558000
1121004234523000
1121004234550000
1121004234513000
1121004234559000

我需要将时间戳转换为人类可读的格式,并根据大于一个值进行选择。

我尝试了这个 sql 查询,但它似乎不起作用,我收到“无效的关系运算符”错误。

SELECT T."Node" as LPAR, CAST((FROM_TZ(CAST(GET_UTC_TIMESTAMP(T."Timestamp", TMZDIFF) AS TIMESTAMP),'+00:00') AT TIME ZONE 'US/Eastern') AS DATE) as TimeStamp,T."MAX_Memory_Size_MB",T."MIN_Comp_Memory",T."AVG_Comp_Memory", T."MAX_Comp_Memory", T."MIN_Non_Comp_Memory", T."AVG_Non_Comp_Memory", T."MAX_Non_Comp_Memory" FROM DW.KPX_PHYSICAL_MEMORY_HV T where T."Node" like 'server%'

and 

CAST((FROM_TZ(CAST(GET_UTC_TIMESTAMP(T."Timestamp", TMZDIFF) AS TIMESTAMP),'+00:00') AT TIME ZONE 'US/Eastern') AS DATE) as TimeStamp > '04-Jun-2013 02:00:00 PM'
4

0 回答 0