Below gives one item but the wrong count
SELECT COUNT(activities.id) FROM activities AS COUNT
[0] => stdClass Object
(
[COUNT] => 189
)
Below gives multiple items but the correct count (total array items)
SELECT COUNT(activities.id) AS COUNT
GROUP BY activities.id
[0] => stdClass Object
(
[COUNT] => 4
)
[1] => stdClass Object
(
[COUNT] => 4
)
How can I use GROUP BY but still only get one count result? (I've tried DISTINCT without luck)
activities.idvalues. How can I use GROUP BY but still only get one count result? What is desired result?8? useGROUP BY NULL...activities.idcolumn into the output list of your query with GROUP BY. Show the output, or at least tell what is this column value in the row where COUNT() is equal to 45.