Index: trunk/ippMonitor/def/simplePlotDiffImage.d
===================================================================
--- trunk/ippMonitor/def/simplePlotDiffImage.d	(revision 37983)
+++ trunk/ippMonitor/def/simplePlotDiffImage.d	(revision 40882)
@@ -1,3 +1,3 @@
-TABLE diffRun, diffSkyfile, skycell 
+TABLE diffRun JOIN diffSkyfile USING (diff_id) JOIN skycell USING (skycell_id) 
 TITLE New sky plot - diff
 FILE  simplePlotDiffImage.php
@@ -5,6 +5,4 @@
 
 WHERE diffRun.state != 'new' 
-WHERE diffRun.diff_id = diffSkyfile.diff_id
-WHERE diffSkyfile.skycell_id = skycell.skycell_id
 WHERE diffRun.tess_id = skycell.tess_id
 
