title: MySQL Joining Multiple Tables
body: <p>I have three tables:</p>
  
  <pre><code>t1.estimate, t1.mid, t1.description, t1.status
  
  t2.mid, t2.mname, t2.mphone, t2.memail
  
  t3.estimate, t3.action
  </code></pre>
  
  <p>I need to join these tables, but that issue that I am having is that t2 and t3 may contain no records to join to t1. Table t1 is the primary table that will have the filter applied. Table t2 will 99.9% of the time contain a match when join 'mid'. But table t3 is a table that only stores information and creates an estimate when a user enters it into the table. There can be 40,000 plus records in t1, but only 5,000 in t3.</p>
  
  <p>Here is my current code, but it's only displaying records that are in all three tables. I would like values to be shown from t1 even if there are no records to join on t2 and t3.</p>
  
  <pre><code>SELECT DISTINCT
      t1.estimate, t1.mid, t2.mname, t1.description,
      t1.status, GROUP_CONCAT(t3.action)
  FROM t1
  LEFT OUTER JOIN t2 ON t1.mid = t2.mid
  LEFT OUTER JOIN t3 ON t1.estimate = t3.estimate
  WHERE t1.status LIKE '0%'
  GROUP BY t3.estimate
  </code></pre>