-- does this result in too many entries (one for each diffInputSkyfile?)
-- all of this is just to get the camera used for the diff run
SELECT
    diffRun.diff_id,
    rawExp.camera,
    diffRun.state
FROM diffRun
JOIN diffInputSkyfile
    USING(diff_id)
JOIN warpSkyfile
    ON  diffInputSkyfile.warp_id    = warpSkyfile.warp_id
    AND diffInputSkyfile.skycell_id = warpSkyfile.skycell_id
    AND diffInputSkyfile.tess_id    = warpSkyfile.tess_id
JOIN warpRun
    ON warpRun.warp_id = warpSkyfile.warp_id
JOIN fakeRun
    USING(fake_id)
JOIN camRun
    USING(cam_id)
JOIN chipRun
    USING(chip_id)
JOIN rawExp
    USING(exp_id)
WHERE
    diffRun.state = 'goto_cleaned'
