Index: trunk/ippTools/share/warptool_definebyquery.sql
===================================================================
--- trunk/ippTools/share/warptool_definebyquery.sql	(revision 23589)
+++ trunk/ippTools/share/warptool_definebyquery.sql	(revision 23612)
@@ -1,6 +1,6 @@
 SELECT
     *
-FROM
-    (SELECT DISTINCT
+FROM (
+    SELECT DISTINCT
         fakeRun.*,
         chipRun.chip_id,
@@ -8,4 +8,5 @@
         rawExp.telescope,
         rawExp.dateobs,
+        rawExp.exp_id,
         rawExp.exp_tag,
         rawExp.exp_name,
@@ -28,10 +29,7 @@
         rawExp.sun_angle
     FROM fakeRun
-    JOIN camRun
-        using(cam_id)
-    JOIN chipRun
-        using(chip_id)
-    JOIN rawExp
-        using(exp_id)
+    JOIN camRun USING(cam_id)
+    JOIN chipRun USING(chip_id)
+    JOIN rawExp USING(exp_id)
     WHERE
-        fakeRun.state = 'full') as Foo
+        fakeRun.state = 'full') AS possibleWarps
