Index: trunk/ippTools/share/camtool_find_pendingimfile.sql
===================================================================
--- trunk/ippTools/share/camtool_find_pendingimfile.sql	(revision 14023)
+++ trunk/ippTools/share/camtool_find_pendingimfile.sql	(revision 14027)
@@ -1,9 +1,8 @@
-SELECT * FROM 
+SELECT DISTINCT * FROM 
      -- the subselect is so where criteria can be specified without knowing
      -- which table the field came from
     (SELECT
-        camPendingExp.*,
-        chipProcessedExp.exp_id,
-        chipProcessedExp.guide_id,
+        camRun.*,
+        chipProcessedImfile.exp_id,
         chipProcessedImfile.class_id,
         chipProcessedImfile.uri,
@@ -16,15 +15,15 @@
         rawExp.telescope,
         rawExp.filelevel
-    FROM camPendingExp
-    JOIN chipProcessedExp
+    FROM camRun
+    JOIN chipRun
         USING(chip_id)
     JOIN chipProcessedImfile
         USING(chip_id)
     JOIN rawExp
-        ON chipProcessedExp.exp_id = rawExp.exp_id
+        ON chipProcessedImfile.exp_id = rawExp.exp_id
     LEFT JOIN camProcessedExp
-        ON camPendingExp.cam_id = camProcessedExp.cam_id
+        ON camRun.cam_id = camProcessedExp.cam_id
     LEFT JOIN camMask
-        ON camPendingExp.label = camMask.label
+        ON camRun.label = camMask.label
     WHERE
         camProcessedExp.cam_id IS NULL
