title: Group function is nested too deeply SQL Error
body: <p>I have a table which looks like this:</p>
  
  <pre><code>+-----------------+--------------+
  | Field           | Type         |
  +-----------------+--------------+
  | orderNumber (PK)| int          |
  | orderDate       | date         |
  | requiredDate    | date         |
  | shippedDate     | date         |
  | status          | char(15)     |
  | comments        | char(200)    |
  | customerNumber  | int          |
  +-----------------+--------------+
  </code></pre>
  
  <p>I need to return the customerNumber which has maximum number of orders.</p>
  
  <p>I tried the following command:</p>
  
  <pre><code>SELECT customerNumber FROM ORDERS WHERE customerNumber IN (SELECT customerNumber FROM ORDERS HAVING MAX(COUNT(customerNumber)) GROUP BY customerNumber);
  </code></pre>
  
  <p>I think an error: group function is nested too deeply</p>