Index: trunk/ippTools/share/difftool_definewarpwarp_select.sql
===================================================================
--- trunk/ippTools/share/difftool_definewarpwarp_select.sql	(revision 27575)
+++ trunk/ippTools/share/difftool_definewarpwarp_select.sql	(revision 27576)
@@ -16,11 +16,15 @@
 JOIN fakeRun AS templateFakeRun
     ON templateFakeRun.fake_id = templateWarpRun.fake_id
+    AND templateFakeRun.fake_id != inputFakeRun.fake_id -- Don't use self as template!
 JOIN camRun AS templateCamRun
     ON templateCamRun.cam_id = templateFakeRun.cam_id
+    AND templateCamRun.cam_id != inputCamRun.cam_id -- Don't use self as template!
 JOIN chipRun AS templateChipRun
     ON templateChipRun.chip_id = templateCamRun.chip_id
+    AND templateChipRun.chip_id != inputChipRun.chip_id -- Don't use self as template!
 JOIN rawExp AS templateRawExp
     ON templateRawExp.exp_id = templateChipRun.exp_id
     AND templateRawExp.filter = inputRawExp.filter
+    AND templateRawExp.exp_id != inputRawExp.exp_id -- Don't use self as template!
 WHERE inputWarpRun.state = 'full'
     AND templateWarpRun.state = 'full'
