Index: trunk/ippMonitor/def/simplePlotStackImage.d
===================================================================
--- trunk/ippMonitor/def/simplePlotStackImage.d	(revision 34436)
+++ trunk/ippMonitor/def/simplePlotStackImage.d	(revision 40882)
@@ -1,3 +1,3 @@
-TABLE stackRun, stackSumSkyfile, skycell 
+TABLE stackRun JOIN stackSumSkyfile USING (stack_id) JOIN skycell USING (skycell_id) 
 TITLE New sky plot - stack
 FILE  simplePlotStackImage.php
@@ -5,6 +5,4 @@
 
 WHERE stackRun.state != 'new' 
-WHERE stackRun.stack_id = stackSumSkyfile.stack_id
-WHERE stackRun.skycell_id = skycell.skycell_id
 WHERE stackRun.tess_id = skycell.tess_id
 
