I am sure there must be a relatively straightforward way to do this, but it is escaping me at the moment. Suppose I have a SQL table like this:
+-----+-----
TRY:
SELECT A, B , COUNT(*) FROM YourTable GROUP BY A, B