Use IS NULL to test whether a value is missing. A comparison such as finished_at = NULL evaluates to unknown, and WHERE keeps only rows where its condition is true.
SELECT id FROM deployments WHERE retries IS NULL;Return the id of every deployment with a missing finish time, whatever its status.