2012-06-30 58 views
3

Vertica中是否有任何內容可以獲得與Oracle中以下Sql查詢所提供的輸出相同的輸出?將一個時區的日期時間值轉換爲Vertica中的另一個時區

SELECT FROM_TZ(CAST(TO_DATE('1999-12-01 11:00:00', 
     'YYYY-MM-DD HH:MI:SS') AS TIMESTAMP), 'America/New_York') 
    AT TIME ZONE 'America/Los_Angeles' "West Coast Time" 
    FROM DUAL; 

West Coast Time 
------------------------------------------------ 
01-DEC-99 08.00.00.000000 AM AMERICA/LOS_ANGELES 

回答

1

我能夠轉換。下面給出的示例查詢:

SELECT TIMESTAMP WITH TIME ZONE '2012-07-02 10:00:00-04' AT TIME ZONE 'GMT'; 
     timezone 
--------------------- 
2012-07-02 14:00:00 
(1 row) 


SELECT TIMESTAMP WITH TIME ZONE '2012-07-02 14:00:00-00' AT TIME ZONE 'EDT'; 
     timezone 
--------------------- 
2012-07-02 10:00:00 
(1 row) 
相關問題