Index: trunk/ippTools/src/addtool.c
===================================================================
--- trunk/ippTools/src/addtool.c	(revision 38359)
+++ trunk/ippTools/src/addtool.c	(revision 38478)
@@ -992,4 +992,5 @@
     PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false);
     PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false);
+    PXOPT_LOOKUP_BOOL(multi, config->args, "-multiadd", false);
     
     psString query = NULL;
@@ -1041,11 +1042,22 @@
     if (strcmp(stage, "diff") == 0) {
       //this group by is needed to join against all the warps (to get camera)
+      if (multi) {
+	psStringAppend(&query, " GROUP BY %s", "diff_id");
+      } else {
       psStringAppend(&query, " GROUP BY %s", "diff_id, stage_extra1");
+      }
     }
     if (strcmp(stage, "fullforce") == 0) {
       //this group by is needed to join against all the warps (to get camera)
-      psStringAppend(&query, " GROUP BY %s", "ff_id, stage_extra1");
-    }
-
+      if (multi) {
+	psStringAppend(&query, "GROUP BY %s", "ff_id");
+      } else {
+	psStringAppend(&query, " GROUP BY %s", "ff_id, stage_extra1");
+      }
+    }
+
+    //    if (multi) {
+    //  psStringAppend(&query, " , %s", "stage_id");
+    //}
 
 
@@ -1061,4 +1073,5 @@
         return false;
     }
+    printf ("%s\n", query);
     psTrace("addtool.c", PS_LOG_INFO, "used this query:\n %s\n",query); 
     psFree(query);
@@ -1101,5 +1114,5 @@
     PXOPT_LOOKUP_S16(fault,         config->args, "-fault", false, false);
     PXOPT_LOOKUP_S64(stage_extra1, config->args, "-stage_extra1", false, false);
-
+    PXOPT_LOOKUP_BOOL(multi, config->args, "-multi", false);
     // generate restrictions
     psMetadata *where = psMetadataAlloc();
@@ -1119,4 +1132,8 @@
     }
     psFree(where);
+
+    if (multi) {
+      psStringAppend(&query, "group by  %s", "stage_extra1");
+    }
 
     if (!p_psDBRunQuery(config->dbh, query)) {
