Index: trunk/ippTools/share/chiptool_pendingimfile.sql
===================================================================
--- trunk/ippTools/share/chiptool_pendingimfile.sql	(revision 14025)
+++ trunk/ippTools/share/chiptool_pendingimfile.sql	(revision 14065)
@@ -1,6 +1,5 @@
 SELECT
     chipRun.*,
-    chipInputImfile.exp_id,
-    chipInputImfile.class_id,
+    rawImfile.class_id,
     rawImfile.uri,
     rawExp.exp_tag,
@@ -10,15 +9,12 @@
     rawExp.filelevel
 FROM chipRun
-JOIN chipInputImfile
-    USING(chip_id)
+JOIN rawExp
+    USING(exp_id)
+JOIN rawImfile
+    USING(exp_id)
 LEFT JOIN chipProcessedImfile
-    ON chipInputImfile.chip_id = chipProcessedImfile.chip_id
-    AND chipInputImfile.exp_id = chipProcessedImfile.exp_id
-    AND chipInputImfile.class_id = chipProcessedImfile.class_id
-JOIN rawImfile
-    ON chipInputImfile.exp_id = rawImfile.exp_id
-    AND chipInputImfile.class_id = rawImfile.class_id
-JOIN rawExp
-    ON rawImfile.exp_id = rawExp.exp_id
+    ON chipRun.chip_id = chipProcessedImfile.chip_id
+    AND rawImfile.exp_id = chipProcessedImfile.exp_id
+    AND rawImfile.class_id = chipProcessedImfile.class_id
 LEFT JOIN chipMask
     ON chipRun.label = chipMask.label
