MySQL: GROUP_CONCAT with an ORDER BY COUNT?
问题 Is this possible ? Let's say I have a list of addresses, with a lot of duplicate entries. I need to filter out all the duplicates, because some addresses have slightly different names but the same postalcode and telephone number. First I do a GROUP BY on postalcode and telephone. SELECT name, address, postalcode, place, phone FROM addresses GROUP BY postalcode, phone But then I get random names. I would like to get the best name, that is, the name with the most entries per postalcode/phone.