Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
WJHamel
Aged Yak Warrior
651 Posts |
Posted - 2011-10-07 : 09:41:05
|
| Help! I have a table which contains a myriad of demographic information for persons. This data also contains AKA's for the same person, sometimes dozens of entries. In almost all cases, the only difference in the demographics are changes to some part of the person's name. Each person is assigned a specific numeric "pin" that is contained within the table as well. So, while John Doe might have an alias "jon doe", his pin would match the "John Doe" entry as well as any other variations of his name or other demographic information. What i need to do is to pull the entries for each PIN which have the most number of other columns populated with other information. I need to then pull that one entry, along with it's information into another table which stores a single name entry per person, away from the AKA's for each person. So, i need a script that looks at the table, identifies the one entry per PIN that has the greatest number of fields populated, and selects that row, along with it's columns to the output i need.Any suggestions?thanksJames |
|
|
jimf
Master Smack Fu Yak Hacker
2875 Posts |
Posted - 2011-10-07 : 09:45:08
|
| Could you provide the CREATE TABLE statements along with some sample data and what your desired result set would like?JimEveryday I learn something that somebody else already knew |
 |
|
|
WJHamel
Aged Yak Warrior
651 Posts |
Posted - 2011-10-07 : 09:54:09
|
| i just recognized that some of the output values i want are not in the table i pulled my desired output from. However, those values, along with all others are actually pulled from a similar table. i can work out that syntax if i can just get a jumpstart on how to pull this data in general. |
 |
|
|
|
|
|
|
|