I wish to SUM the COUNT of a query as follows. This query returns the count properly (1) for each row, but not sure how to add them all up.
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
Table Structure is
jss_order_headers
orderID, etc
jss_order_extrafields
exid, orderID, extrafieldID, extrafieldName, content
This currently returns data as follows:
COUNT() | orderID | etc
1 | 99
1 | 104
1 | 106
I need to return the SUM of the COUNT() column. So in the 3 examples above I would return 3.
Many thanks