I listened to any help in building the SQL stat. I currently have the following:
SELECT a, b, count(1) FROM table GROUP BY a, b ORDER BY a asc, count(1) DESC
Each row displays the sum of all unique Bs in each group a and orders alphabetically, and then by the highest occurrence of B at the lowest. I would like that I could sort by the sum in each group A (consider each row as an intermediate result).
source share