title: Select from two tables with group by date
body: <p>I have two tables:</p>
  
  <p>Table t1:</p>
  
  <pre><code>id | date_click
   1 | 2016-02-31 17:17:23
   2 | 2016-03-31 12:11:21
   3 | 2016-03-31 13:13:23
  </code></pre>
  
  <p>So from this table I want to get count field <code>Id</code> for each day.</p>
  
  <p>For this I use next query:</p>
  
  <pre><code>SELECT date_format(date_click, '%Y-%m-%d') as date_click_event
       , COUNT(id) as count_click 
    FROM t1 
   GROUP 
      BY date_click_event 
   ORDER 
      BY date_click_event DESC;
  </code></pre>
  
  <p>It's work good. </p>
  
  <p>So next table is t2.</p>
  
  <pre><code>id | count | date_sent
   1 |    33 | 2016-02-31 11:12:23
   2 |    22 | 2016-03-31 14:11:22
   3 |    11 | 2016-03-31 13:12:13
  </code></pre>
  
  <p>To select data by date from this table I use next query:</p>
  
  <pre><code>SELECT date_format(date_sent, '%Y-%m-%d') as date_sent_push
       , SUM(count) as count_sent 
    FROM t2 
   GROUP 
      BY date_sent_push 
   ORDER 
      BY date_sent_push DESC 
   LIMIT 100;
  </code></pre>
  
  <p>It's also work good. So my purpose is merge these two queries into one <code>SELECT</code> that next I can write in php one tables with count of <code>Id</code> by date from table <code>t1</code> and with count of <code>count</code> field from table <code>t2</code> by date.</p>
  
  <p>When I try next query:</p>
  
  <pre><code>SELECT date_format(t2.date_sent, '%Y-%m-%d') AS date_sent_push
       , SUM(t2.count) as count_sent
       , COUNT(t1.id) as count_click 
    FROM t2
       , t1 
   WHERE date_format(t2.date_sent, '%Y-%m-%d') = date_format(t1.date_click, '%Y-%m-%d') 
   GROUP 
      BY date_sent_push 
   ORDER 
      BY date_sent_push 
    DESC 
   LIMIT 100;
  </code></pre>
  
  <p>It's not work. What I do wrong?</p>