title: SQL - ordering left joins and main results
body: <p>I'm currently trying to return all engineers from the database. Along with that, some other userfull information. But i want the ac table to JOIN the most recent row, and then order the main results by contactname.</p>
  
  <p>Can anyone chuck me in the right direction?</p>
  
  <pre><code>SELECT 
      mb.type, mb.contactname, mb.id, mb.inv_addressline2, mb.inv_addressline3, mb.signup_date,
      fb.engineer_id, fb.job_id, fb.neg_or_pos, fb.rating, fb.author_id,
      ac.engineer_id, ac.timestamp, ac.author_id,
      jb.job_id, SUBSTRING(jb.job_description, 0, 200) AS `short_description`, jb.timestamp 
  FROM " . MEMBERS_TABLE . " AS mb 
  LEFT JOIN " . ACCEPTED . " AS ac ON mb.id = ac.engineer_id 
  LEFT JOIN " . FEEDBACK . " AS fb ON ac.job_id = fb.job_id 
  LEFT JOIN " . JOBS . " AS jb ON fb.job_id = jb.job_id 
  WHERE mb.type = 2 
  GROUP BY mb.contactname 
  ORDER BY ac.timestamp DESC
  </code></pre>