From Stack Overflow:
I have whole bunch of contact data that may or may not contain all info, like this:
Name | Address1 | Address2 | |
---|---|---|---|
Test User | Address1 | Address2 | test@example.com |
NULL | NULL | NULL | test@example.com |
For each email address, I would love to extract the most relevant record, that is the row with the contact information rather than the row with empty fields
To do this we need a sorting criterion: how to tell that a record is considered more relevant than …
[Read more]