What I need is a query on a table that would return distinct combinations of columns A and B, along with the count of how many times each combination occurs in the table. This w
Use GROUP BY like this
GROUP BY
SELECT `A`, `B`, COUNT(*) AS `Count` FROM `table` GROUP BY `A`, `B` ORDER BY `A`