title: SQL select total and split into success and failed
body: <p>I have two tables</p>
  
  <pre><code>Table 1                Table 2                   
  |leadid|Location|      |leadid|leadstatus|       
  |---------------|      |-----------------|
  |1     |Japan   |      |1     | Hired    |
  |2     |China   |      |2     | Failed   |
  |3     |Korea   |      |3     | Hired    |
  |4     |Japan   |      |4     | Hired    |
  |5     |Japan   |      |5     | Hired    |
  </code></pre>
  
  <p>My objective is to count the number of interviews per country and also count the number of hires and failed in each country. The resulting table should be like this</p>
  
  <pre><code>|Location|Interview|Hired|Failed|
  |-------------------------------|
  |Japan   | 3       |3    |0     |
  |Korea   | 1       |1    |0     |
  |China   | 1       |0    |1     |
  </code></pre>
  
  <p>I have already done the counting of interviews per country. MY problem is I cannot count the number of hires and failed in each country.
  Here is my MySQL code as of the moment:</p>
  
  <pre><code>SELECT Location, count(*) as Interview 
  FROM table1 
  GROUP BY Location 
  ORDER BY Interview DESC
  </code></pre>