title: SQL select query into delete statement
body: <p>I have the following query:</p>
  
  <pre><code>select acc.Username from accounts acc
  left join accountevents ace on acc.accountid=ace.accountid
  left join leads lds on lds.leadid=acc.leadid
  where lds.DateEntered&gt;'2011-01-01' and lds.DateEntered&lt;'2011-02-01'
  Group by acc.Username
  Having count(ace.accounteventid)=0
  </code></pre>
  
  <p>I wanted to make it a delete statement:</p>
  
  <pre><code>delete username from accounts 
  left join accountevents ace on accounts.accountid=ace.accountid 
  left join leads lds on lds.leadid=accounts.leadid
  where Leads.DateEntered&gt;'2011-01-01' and lds.DateEntered&lt;'2011-02-01' 
  Having count(accountevents.accounteventid)=0
  </code></pre>
  
  <p>And i get the following error:
  Incorrect syntax near the keyword 'Having'.</p>
  
  <p>Any suggestions?</p>