Index: /trunk/ippTools/src/detselect.c
===================================================================
--- /trunk/ippTools/src/detselect.c	(revision 9403)
+++ /trunk/ippTools/src/detselect.c	(revision 9404)
@@ -72,6 +72,5 @@
         "SELECT"
         "   detNormalizedImfile.det_id,"
-        "   detNormalizedImfile.iteration,"
-        "   detNormalizedImfile.class_id"
+        "   detNormalizedImfile.iteration"
         " FROM detRun"
         " JOIN detInputExp"
@@ -80,10 +79,10 @@
         "   ON detRun.position = detInputExp.det_id"
         " JOIN detNormalizedImfile"
-        "   ON detInputExp.position = detNormalizedImfile.det_id"
+        "   ON detInputExp.det_id = detNormalizedImfile.det_id"
         "   AND detInputExp.iteration = detNormalizedImfile.iteration"
         " JOIN rawDetrendExp"
         "   ON detInputExp.exp_tag = rawDetrendExp.exp_tag"
         " JOIN detRunSummary"
-        "   ON detInputExp.position = detRunSummary.det_id"
+        "   ON detInputExp.det_id = detRunSummary.det_id"
         "   AND detInputExp.iteration = detRunSummary.iteration"
         " WHERE"
