title: MySql GROUP BY date_time and SUM quantity
body: <p>In report table, there are multiple <strong>date_time</strong> and <strong>quantity</strong> records for each day. I want to select sum of quantity for each day's record separately.</p>
  <pre><code>connection.query(&quot;SELECT  date_time, quantity FROM report WHERE date_time BETWEEN ? AND  ?&quot;, [fromDate_query, toDate_query], function (err, rows) {
    if (err) console.log(err);
    else {
      for (var i = 0; i &lt; rows.length; i++) {
        var row = rows[i];
        console.log(&quot;**********************************&quot;);
        console.log(&quot;date_time : &quot; + row.date_time);
        console.log(&quot;quantity : &quot; + row.quantity);
        console.log(&quot;**********************************&quot;);
      }
      io.emit(&quot;chart&quot;, rows);
    }
  });
  </code></pre>
  <hr />
  <p>Table Example</p>
  <pre><code>| date_time           | quantity
  -------------------------
  | 2017-08-13 11:12:51 | 1
  | 2017-08-13 12:45:51 | 1
  | 2017-08-13 13:57:51 | 1
  | 2017-08-14 14:23:51 | 1
  | 2017-08-14 16:34:51 | 1
  | 2017-08-15 16:21:51 | 1
  | 2017-08-16 14:31:51 | 1
  </code></pre>
  <p>After selection</p>
  <pre><code>| date_time  | quantity
   -------------
  | 2017-08-13 | 3
  | 2017-08-14 | 2
  | 2017-08-15 | 1
  | 2017-08-16 | 1
      
  </code></pre>
  <p><em>How can I make this happen?</em></p>