title: SubSelect or Joins? Is there a better way to write this mysql query?
body: <p>I know there is always a better way to do something, but I'm not sure how? What is the best way to optimize this query? Should I use Joins, a separate query, etc.. I know it's not a complex query.. just trying to expand my knowledge. </p>
  
  <p>Any suggestions would be appreciated!</p>
  
  <pre><code>SELECT
    community_threads.id AS thread_id,
    community_threads.title AS thread_title,
    community_threads.date AS thread_date,
    community_threads.author_id AS author_id,
    `user`.display_name AS author_name,
    `user`.organization AS author_organization,
    (SELECT date FROM community_replies replies WHERE replies.thread_id = community_threads.id ORDER BY date DESC LIMIT 1) AS reply_date,
    (SELECT   count(id) FROM community_replies replies WHERE replies.thread_id = community_threads.id ORDER BY date DESC LIMIT 1) AS total_replies
  FROM
    community_threads
  INNER JOIN `user` ON community_threads.author_id = `user`.id
  WHERE
    category_id = '1'
  ORDER BY
    reply_date DESC
  LIMIT 0, 5
  </code></pre>