Index: trunk/ippTools/share/staticskytool_revert.sql
===================================================================
--- trunk/ippTools/share/staticskytool_revert.sql	(revision 28154)
+++ trunk/ippTools/share/staticskytool_revert.sql	(revision 35039)
@@ -1,5 +1,9 @@
 DELETE FROM staticskyResult
-USING staticskyResult, staticskyRun
+USING staticskyResult, staticskyRun, staticskyInput, stackRun, skycell
 WHERE staticskyRun.sky_id = staticskyResult.sky_id
+    AND staticskyRun.sky_id = staticskyInput.sky_id
+    AND staticskyInput.stack_id = stackRun.stack_id
+    AND stackRun.tess_id = skycell.tess_id
+    AND stackRun.skycell_id = skycell.skycell_id
     AND staticskyRun.state = 'new'
     AND staticskyResult.fault != 0
