SELECT
    warpRun.warp_id,
    warpRun.cam_id,
    warpRun.workdir,
    warpRun.tess_id,
    warpRun.label,
    rawExp.camera,
    exp_id,
    warpRun.magiced
FROM warpRun
JOIN camProcessedExp
    USING(cam_id)
JOIN chipRun
    USING(chip_id)
JOIN rawExp
    USING(exp_id)
LEFT JOIN warpSkyCellMap
    USING(warp_id, cam_id)
LEFT JOIN warpMask
    ON warpRun.label = warpMask.label
WHERE
    warpRun.state = 'run'
    AND camProcessedExp.fault = 0
    AND warpSkyCellMap.warp_id IS NULL
    AND warpSkyCellMap.cam_id IS NULL
    AND warpMask.label IS NULL
