Dette vil give dig fristen :
select id,
title,
created_at + interval '1' day * claim_window as deadline
from projects
Alternativt funktionen make_interval
kan bruges:
select id,
title,
created_at + make_interval(days => claim_window) as deadline
from projects
For at få alle projekter, hvor deadline er overstået, skal du bruge:
select *
from (
select id,
created_at + interval '1' day * claim_window as deadline
from projects
) t
where localtimestamp at time zone 'UTC' > deadline