title: mysql query doesnot work
body: <p>This is my mysql query! </p>
  
  <pre><code>SELECT projects.projects_id, 
         projects.projects_title,
         projects.projects_cost
    FROM projects
         LEFT JOIN invoice
             ON invoice.projects_id = projects.projects_id
         LEFT JOIN project_assign
             ON project_assign.projects_id=projects.projects_id
   WHERE project_assign.assigned_user_id=3 
         AND (SUM( invoice.invoice_amount) &lt; projects.projects_cost 
              OR invoice.projects_id is null )
         AND project_assign.project_completed_date IS NOT NULL
  </code></pre>
  
  <p>In this query i want select all row that:</p>
  
  <blockquote>
    <ol>
    <li>Is not present in other table  e.g. (in my case other table is
    "invoice") </li>
    <li>Or if persent then this condition must hold <code>sum(invoice.invoice_amount) &lt; projects.projects_cost</code></li>
    </ol>
  </blockquote>
  
  <p>Thanks.</p>