I'm trying to write a query that uses postgres. My query needs to find the diffrence between the started_at time and now() and then only
select the data where the difference is >= 300 seconds.
Here is what I have so far
SELECT id, (extract(epoch from now()) - extract(epoch from started_at)) completed_time
FROM run_item WHERE started_at IS NOT NULL AND completed_at is NULL;