I have batches and tasks. Upon batching some tasks into another batch I want to close all batches that are now empty by marking deleted = true. I tried to simply select using a join only the batches that have no tasks.:
SELECT id FROM batches INNER JOIN tasks on batches.id = tasks.batch_id where count(tasks.id) > 0
But this does not seem to work.
Change to an outer join. Inner join won’t work to get non-matches.