I want to group items only when there are more than 2 rwos matching rule. How can this be done?
E.G: (grouping by Col)
Col
----
A
A
B
B
B
Should return:
Col | count(*)
---------------
A 2
A 2
B 3
It only displays B once since there are more than 3 results.
Since MySQL doesn’t have COUNT OVER you need a inline view to get the counts for when the count is less then 3. Then its just a union to a normal count query
See it working here