-- need to restrict to a single detRunSummary (require all to say 'cleaned'?)
SELECT
    detProcessedImfile.*,
    detRunSummary.data_state
FROM detRunSummary
JOIN detProcessedImfile
    USING(det_id)
WHERE
    detRunSummary.data_state = 'goto_cleaned'
AND detProcessedImfile.data_state = 'full'
