I have the unfortunate luck of having to deal with a db that contains duplicates of particular records, I am looking for a quick way to say "get the most populated record and update the duplicates to match it".
From there I can select distinct records and get a useful set of records.
Any ideas?
It's mainly names and addresses if that helps...
Ok lots of questions asked here so i'll add little bit more:
Firstly I want to pull the most "populated" not most "popular", this means the row with the most values that are not null.
Once I have the set (which is easy because in my case the id's match) I can then populate the missing values in the other rows.
I don't want to destroy data and i only intend to update data based on an accurate match (eg by id).
My problem at the moment is figuring out which of a set of rows has the most populated fields, having said that since posting this question I have found a different way to solve my bigger problem which is what to send to a remote server however I'm still interested to know what the solution to this might be.
Sample data might look something like this ...
id name addr1 addr2 ect
1 fred 1 the street Some town ...
1 fred null null null
Given a table full of matching pairs like this I want to find the pairs then grab the one with the info in it and insert those values where there is a null in the other row.