Richlewis
Richlewis

Reputation: 15374

Update current timestamp plus x amount of days

If I have a column of membership_expiry_date TIMESTAMP (postgresql) and want to get the current expiry date and add 3 days to it, how would I write this query

UPDATE users SET membership_expiry_date = ??

How do I retrieve the current value and add to it?

Upvotes: 0

Views: 849

Answers (1)

maririna
maririna

Reputation: 51

UPDATE users 
    SET membership_expiry_date = membership_expiry_date + 3* INTERVAL '1 day'

Upvotes: 1

Related Questions