title: Mysqli select average of count query
body: <p>I am attempting to get the average number of unique items sold. The database structure is like:</p>
  
  <pre><code>ID    ItemSize    ItemColor    DateSold
  </code></pre>
  
  <p>If I do this query:</p>
  
  <pre><code>SELECT Count(*) AS COUNT FROM store_sales GROUP BY ItemSize, ItemColor
  </code></pre>
  
  <p>... This will give me the total sold for each item whose size and color are the same. </p>
  
  <p>I need to get the AVERAGE of all the numbers in this result set. How would I do this?</p>
  
  <p>** Sample Data **</p>
  
  <p><code>store_sales</code>:</p>
  
  <pre><code>ID    ItemSize    ItemColor
  1     3           5
  2     3           5
  3     2           5
  4     2           6
  5     2           6
  6     2           6
  </code></pre>
  
  <p>Query:</p>
  
  <pre><code>Select Count(*) AS COUNT FROM store_sales GROUP BY ItemSize, ItemColor
  </code></pre>
  
  <p>Result:</p>
  
  <pre><code>Array ( 
    [0] =&gt; Array ( [Count] =&gt; 2 ) 
    [1] =&gt; Array ( [Count] =&gt; 1 ) 
    [2] =&gt; Array ( [Count] =&gt; 3 ) 
  ) 
  </code></pre>
  
  <p>I am attempting to get the average. I would like to return <code>2</code>.</p>