SELECT * FROM 
     -- the subselect is so where criteria can be specified without knowing
     -- which table the field came from
    (SELECT
        camPendingExp.*,
        chipProcessedExp.exp_tag,
        chipProcessedExp.guide_id,
        chipProcessedImfile.class_id,
        chipProcessedImfile.uri,
        chipProcessedImfile.bg,
        chipProcessedImfile.bg_stdev,
        chipProcessedImfile.bg_mean_stdev,
        chipProcessedImfile.path_base,
        rawExp.exp_id,
        rawExp.camera,
        rawExp.telescope,
        rawExp.filelevel
    FROM camPendingExp
    JOIN chipProcessedExp
        USING(chip_id)
    JOIN chipProcessedImfile
        USING(chip_id)
    JOIN rawExp
        ON chipProcessedExp.exp_tag = rawExp.exp_tag
    LEFT JOIN camProcessedExp
        ON camPendingExp.cam_id = camProcessedExp.cam_id
    LEFT JOIN camMask
        ON camPendingExp.label = camMask.label
    WHERE
        camProcessedExp.cam_id IS NULL
        AND camMask.label IS NULL) as foo
