How to limit an SQL result set to not too common items
问题 Problem: I have a list of names and addresses. Some names (persons) have the same address (street, zip code, town) like others. I want to select all those names with addresses with no more than three occurrences and from the rest the first three names each of a bunch pointing to the same address. Example: Albert | Adr1 Berta | Adr1 Cesar | Adr1 Donald | Adr1 Eric | Adr2 Fritz | Adr2 Gerd | Adr2 Henry | Adr3 The result set should be Albert | Adr1 Berta | Adr1 Cesar | Adr1 Eric | Adr2 Fritz |