I have a table with some legacy data that I suspect may be a little messed up. It is a many-to-many join table.
LIST_MEMBERSHIPS
----------------
list_id
address_id
I'd like to run a query that will count the occurrences of each list_id
-address_id
pair and show the occurrence count for each from highest to lowest number of occurrences.
I know it's got to involve COUNT()
and GROUP BY
, right?