title: MySQL SUM of a COUNT with GROUP BY clause
body: <p>I wish to <code>SUM</code> the <code>COUNT</code> of a query as follows. This query returns the count properly (1) for each row, but not sure how to add them all up.</p>
  
  <pre><code>SELECT COUNT(*), jss_orders_headers.*  FROM jss_orders_headers
  LEFT JOIN jss_orders_extrafields
  ON jss_orders_headers.orderID = jss_orders_extrafields.orderID
  AND jss_orders_extrafields.extraFieldID = 5
  GROUP BY jss_orders_headers.orderID
  ORDER BY jss_orders_headers.orderID DESC
  </code></pre>
  
  <p>Table Structure is</p>
  
  <h2>jss_order_headers</h2>
  
  <p>orderID,
  etc</p>
  
  <h2>jss_order_extrafields</h2>
  
  <p>exid,
  orderID,
  extrafieldID,
  extrafieldName,
  content</p>
  
  <p>This currently returns data as follows:</p>
  
  <h2>COUNT() | orderID  | etc</h2>
  
  <p>1   |  99</p>
  
  <p>1   |      104</p>
  
  <p>1   |      106</p>
  
  <p>I need to return the <code>SUM</code> of the <code>COUNT()</code> column. So in the 3 examples above I would return <code>3</code>.</p>
  
  <p>Many thanks</p>