I have a column in my teradata table which stores timestamp in UNIX/EPOCH form. I want to run a query and get the corresponding Date in PST and number of records against that date. I got the following query to convert the EPOCH time to Date, but not able to figure out how to get the corresponding PST date.
SELECT CAST (CAST(DATE '1970-01-01' + (CAST (TIME_CREATED AS INTEGER)/86400 ) AS TIMESTAMP(0) ) + ((CAST (TIME_CREATED AS INTEGER) MOD 86400 ) * INTERVAL '00:00:01' HOUR TO SECOND) AS DATE), COUNT(ID) FROM MY_TABLE GROUP BY 1
Forums: