title: SQL not a single-group group function
body: <p>When I run the following SQL statement:</p>
  
  <pre><code>SELECT MAX(SUM(TIME))
  FROM downloads
  GROUP BY SSN
  </code></pre>
  
  <p>It returns the maximum sum value of downloads by a customer, however if I try to find the social security number that that max value belongs to by adding it to the select statement:</p>
  
  <pre><code>SELECT SSN, MAX(SUM(TIME))
  FROM downloads
  GROUP BY SSN
  </code></pre>
  
  <p>I get the following error:</p>
  
  <blockquote>
    <p>not a single-group group function</p>
  </blockquote>
  
  <p>I do not understand why it is throwing this error. A google search came up with the following action:</p>
  
  <p>Drop either the group function or the individual column expression from the SELECT list or add a GROUP BY clause that includes all individual column expressions listed</p>
  
  <p>From what I think this is saying
  - dropping the group function makes the sum value invalid
  - droping the individual column expression (SSN) will just give me the max sum
  - not sure about that third part.</p>
  
  <p>Could anyone guide in the right direction?</p>
  
  <p>-Tomek</p>
  
  <p>EDIT: TIME in this database refers to the number of times downloaded</p>