title: Delete statement SQL joins
body: <p>Can anyone please tell me how to write a delete statement for the following query:</p>
  
  <pre><code>      SELECT     a.UserID, b.UserEmailAddress
        FROM  tblUserProgramme AS a LEFT OUTER JOIN
  
        tblUser AS b ON b.UserID = a.UserID LEFT OUTER JOIN
        tblWorkGroup AS c ON c.WorkGroupID = b.WorkGroupID
  
        WHERE(a.ProgrammeID = 59) AND (a.UserID NOT IN
  
            (SELECT     UserID FROM tblUser AS a WHERE (WorkGroupID IN
               (SELECT     WorkGroupID FROM tblWorkGroup WHERE                          
               (WorkGroupName  LIKE  '%Insight%') OR (WorkGroupName LIKE '%Other%'))))) 
  
        AND (b.UserEmailAddress NOT IN
              (SELECT     email FROM          tmpUsers))
  
        ORDER BY b.UserEmailAddress
  </code></pre>
  
  <p>SERVER is SQL Server 2005</p>