Index: trunk/ippTools/share/Makefile.am
===================================================================
--- trunk/ippTools/share/Makefile.am	(revision 36529)
+++ trunk/ippTools/share/Makefile.am	(revision 36543)
@@ -105,4 +105,5 @@
 	detselect_search.sql \
 	detselect_select.sql \
+	detselect_show.sql \
 	dettool_addprocessedexp.sql \
 	dettool_childlessrun.sql \
Index: trunk/ippTools/share/detselect_show.sql
===================================================================
--- trunk/ippTools/share/detselect_show.sql	(revision 36543)
+++ trunk/ippTools/share/detselect_show.sql	(revision 36543)
@@ -0,0 +1,32 @@
+-- this query needs to use the same fields in both of the tables in
+-- the union statement, but we need to report the
+-- detRunSummary.iteration in the first case, and this is missing in
+-- the second case.
+
+SELECT DISTINCT
+    det_id,
+    good_iteration as iteration,
+    filelevel,
+    filter,
+    time_begin,
+    time_end
+FROM
+    (SELECT DISTINCT
+	detRun.*,
+	detRunSummary.iteration as good_iteration
+    FROM detRun
+    JOIN detRunSummary
+        USING(det_id)
+    WHERE
+       detRun.mode  = 'master'
+       AND detRunSummary.accept = 1
+    UNION
+    SELECT DISTINCT
+	detRun.*,
+	detRun.iteration as good_iteration
+    FROM detRun
+    WHERE
+       (detRun.mode  = 'register' OR detRun.mode = 'correction')
+    ) as Foo
+WHERE
+    (state = 'stop')
