substract variable amount of minutes from timestamp postgresql 1

substract variable amount of minutes from timestamp postgresql

SELECT p.date_time + number_of_seconds * INTERVAL '1 second'
    FROM photo p 
    WHERE p.id = 1;

Here is what the above code is Doing:
1. We’re selecting the date_time column from the photo table.
2. We’re adding the number_of_seconds column from the photo table multiplied by an interval of 1 second.
3. We’re filtering the query to only return the row where the id column is 1.

Similar Posts