SELECT DISTINCT * FROM 
     -- the subselect is so where criteria can be specified without knowing
     -- which table the field came from
    (SELECT
        camRun.*,
        chipProcessedImfile.exp_id,
        chipProcessedImfile.class_id,
        chipProcessedImfile.uri,
        chipProcessedImfile.bg,
        chipProcessedImfile.bg_stdev,
        chipProcessedImfile.bg_mean_stdev,
        chipProcessedImfile.fringe_0,
        chipProcessedImfile.fringe_1,
        chipProcessedImfile.fringe_2,
        chipProcessedImfile.ap_resid,
        chipProcessedImfile.ap_resid_stdev,
        chipProcessedImfile.sigma_ra,
        chipProcessedImfile.sigma_dec,
        chipProcessedImfile.n_stars,
        chipProcessedImfile.n_extended,
        chipProcessedImfile.n_cr,
        chipProcessedImfile.n_astrom,
        chipProcessedImfile.path_base,
        rawExp.exp_name,
        rawExp.camera,
        rawExp.telescope,
        rawExp.filelevel
    FROM camRun
    JOIN chipRun
        USING(chip_id)
    JOIN chipProcessedImfile
        USING(chip_id)
    JOIN rawExp
        ON chipProcessedImfile.exp_id = rawExp.exp_id
    LEFT JOIN camProcessedExp
        USING(cam_id)
    LEFT JOIN camMask
        ON camRun.label = camMask.label
    WHERE
        camMask.label IS NULL) as foo
