title: I want to get sum of day sale report with condition
body: <p>I want to get document total of sales , in all the line of item summary of the day.</p>
  
  <p><a href="http://sqlfiddle.com/#!9/61dc69/1" rel="nofollow noreferrer">http://sqlfiddle.com/#!9/61dc69/1</a></p>
  
  <pre><code>CREATE TABLE IF NOT EXISTS `sale` (
    `item_ID` int(6) unsigned NOT NULL,
    `'date` int(3) unsigned NOT NULL,
    `amount` varchar(200) NOT NULL,
    `qty` varchar(200) NOT NULL,
   )
  
  INSERT INTO `sale` (`item_ID`, `date`, `amount`,  `qty `) VALUES
  
    ('2', '20190120', '10050','1'),
    ('2', '20190120', '10050','1'),
    ('4', '20190120', '9045','1'),
    ('6', '20190121', '10050','1'),
    ('4', '20190121', '20050','2')
  </code></pre>
  
  <pre><code>select   item_ID,date,sum( amount) as amount,
  sum(qty) as qty from sale
  group by item_ID,date
  </code></pre>
  
  <p>I want to  calculate document total per day<code>date</code> as a filter,  and the amount and qty is based on <code>item and date</code> as filter</p>
  
  <p>My expected output is as below:</p>
  
  <pre><code>item_ID  date      amount  qty  document total
  2        20190120  20100    2    29145
  4        20190120   9045    1    29145
  6        20190121  10050    1    30100
  4        20190121  20050    2    30100
  </code></pre>