Index: trunk/ippTools/share/stacktool_definebyquery_select.sql
===================================================================
--- trunk/ippTools/share/stacktool_definebyquery_select.sql	(revision 18574)
+++ trunk/ippTools/share/stacktool_definebyquery_select.sql	(revision 18577)
@@ -1,2 +1,7 @@
+-- This is the SELECT part of the query to get a list of skycells with
+-- warps that are ready to be stacked, along with the numbers of warps
+-- ready to be stacked and already in stacks.  It needs to be
+-- completed by a GROUP BY statement (see below).
+
 SELECT
     warpSkyfile.skycell_id,
@@ -4,6 +9,6 @@
     stackRun.stack_id,
     rawExp.filter,
-    COUNT(warpSkyfile.skycell_id) AS num_avail,
-    COUNT(stackRun.stack_id) AS num_extant
+    COUNT(warpSkyfile.skycell_id) AS num_avail, -- number available to be stacked
+    COUNT(stackRun.stack_id) AS num_extant -- number already in the stack
 FROM warpRun
 JOIN warpSkyfile 
@@ -28,3 +33,3 @@
     AND warpSkyfile.fault = 0
 -- Here should follow the SQL in stacktool_definebyquery_groupby.sql,
--- after additional WHERE conditions have been added
+-- after any additional WHERE conditions have been added
