-- Get a list of exposures on which magic may be performed
SELECT 
    exp_id,
    MAX(diffRun.diff_id) AS diff_id
FROM diffRun
JOIN rawExp USING(exp_id)
LEFT JOIN magicRun USING(exp_id)
-- WHERE hook %s
GROUP BY exp_id
