Index: trunk/ippTools/share/stacktool_definebyquery_test.sql
===================================================================
--- trunk/ippTools/share/stacktool_definebyquery_test.sql	(revision 19092)
+++ trunk/ippTools/share/stacktool_definebyquery_test.sql	(revision 19258)
@@ -24,9 +24,9 @@
         COUNT(warpSkyfile.skycell_id) AS num_warp -- number of warps that can be stacked
     FROM warpRun
-        JOIN warpSkyfile USING(warp_id, tess_id)
-        JOIN fakeRun USING(fake_id, tess_id)
-        JOIN camRun USING(cam_id, tess_id)
-        JOIN chipRun USING(chip_id, tess_id)
-        JOIN rawExp USING(exp_id, tess_id)
+        JOIN warpSkyfile USING(warp_id)
+        JOIN fakeRun USING(fake_id)
+        JOIN camRun USING(cam_id)
+        JOIN chipRun USING(chip_id)
+        JOIN rawExp USING(exp_id)
     WHERE
         warpRun.state = 'full'
@@ -52,9 +52,8 @@
         ) AS stackSizes
     -- JOINing the warpsToStack and stackSizes tables
-        USING(skycell_id, tess_id, filter)
+        USING(skycell_id, filter)
         )
     GROUP BY
         skycell_id,
-        tess_id,
         filter
 ;
