0

New to SQL

I am using the TO_TIMESTAMP feature to change a column to datetime. Is there anyway I can apply a subtraction of 5 hours into the TO_TIMESTAMP function that would apply it everytime the SQL is ran?

How I am using it currently:

select col1
TO_TIMESTAMP(col2,'YYYY-MM-DD"T"HH24:MI:SS"Z"' ) as col2 from table
RustyShackleford
  • 3,462
  • 9
  • 40
  • 81

1 Answers1

1

check this

SELECT 
  TO_TIMESTAMP(col2,'YYYY-MM-DD"T"HH24:MI:SS"Z"' ) - INTERVAL '5' HOUR td
FROM Table1
Derviş Kayımbaşıoğlu
  • 28,492
  • 4
  • 50
  • 72