Answer the question
In order to leave comments, you need to log in
How to subtract the calculated number of days from a date in Postgres?
In the plate, a certain hour is written in the tick field. I have added a new ts column to the table and want to update it based on the tick column. And something does not work in postgres to write UPDATE.
In a db2 database, update would look like this
update set ts = (current_timestamp - (tick * 10 / 60 / 60 / 24) days) .
set ts = current_timestamp - interval '10 day'
set ts = current_timestamp - interval cast(tick * 10 / 60 / 60 / 24 as string) || ' day'
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question