SELECT
    detResidExp.*,
    detRunSummary.data_state
FROM detRunSummary
JOIN detResidExp
    USING(det_id,iteration)
WHERE
    detRunSummary.data_state = 'goto_cleaned'
AND detResidExp.data_state = 'full'
