Of voeg gewoon NULLIF toe aan uw bestaande COALESCE -
SELECT
taskDeadline,
subtasksDeadline,
NULLIF(
LEAST(
COALESCE(NULLIF(t.deadline, 0), 2147483647),
COALESCE(NULLIF(sub.deadline, 0), 2147483647)
), 2147483647
) AS Deadline
FROM
tasks t
LEFT OUTER JOIN subtasks sub ON sub.task_id = t.id