How to select rows with duplicate values (non-distinct rows) and summarize with a count of the number of duplicate values in order of the most frequent duplicates?
Given a table of:
…with this data:
Bob Brown Lucy Lavender Orin Orange Liam Lavender Betty Brown Blair Brown
3 Brown 2 Lavender
We omit “Orange” from the list as it is distinct, with no duplicate siblings.
I am most interested in Postgres, but I expect this can be done in standard SQL.