title: MySQL - Max,min, avg & daily data at same time
body: <p>I'm using MySQL database. The data I'm using is here- <a href="https://www.dropbox.com/s/whrer73w5izv6u9/SALES.csv?dl=0" rel="nofollow noreferrer">Sales_history</a>. I'm looking to extract the maximum &amp; average of the values of the data in table (Not max &amp; avg per day. It's the avg &amp; max of the whole set of data) &amp; at the same time print the data per day too.</p>
  
  <p>I'd like the output to look as below</p>
  
  <p><a href="https://i.stack.imgur.com/x9IdH.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/x9IdH.png" alt="enter image description here"></a></p>
  
  <p>The query I've written up so far is </p>
  
  <pre><code>SELECT 
  SALES_DATE,
  NUM_SALES,
  MIN(NUM_SALES) AS MIIN,
  MAX(NUM_SALES) AS MAAX,
  TRUNCATE(AVG(NUM_SALES),2) AS AVVG
  FROM SALES_HISTORY
  GROUP BY
  SALES_DATE
  </code></pre>
  
  <p>This obviously groups <code>MAX</code>, <code>MIN</code> &amp; <code>AVG</code> per day which is not what I want. Could I please get help to achieve this?</p>