| Author |
Topic |
|
ntn104
Posting Yak Master
175 Posts |
Posted - 2008-09-08 : 11:49:28
|
| hello,Is there something we can do to pick out similar names and matching address’s to combine them? For example: in my table 1, there are one lawyer, but table reported 2 name with same address, but spell differnt...see example below:LIST 1:AARON S FRIEDMANADDRESS: STE355 1617 JFK ST PHILADELPHIA, PALIST 2:AARON S FRIEDNAMNADDRESS: SAME AS LIST 1The correct name is list 2. Thanks,Please show me how to combine them so we don't duplicate sending letter twice. |
|
|
jsmith8858
Dr. Cross Join
7423 Posts |
|
|
bjoerns
Posting Yak Master
154 Posts |
Posted - 2008-09-08 : 12:14:26
|
If the addresses match exactly, you could do something likeselect l1.name, l2.namefrom list l1inner join list l2on l1.address = l2.addresswhere l1.name < l2.name |
 |
|
|
ntn104
Posting Yak Master
175 Posts |
Posted - 2008-09-08 : 12:28:17
|
quote: Originally posted by bjoerns If the addresses match exactly, you could do something likeselect l1.name, l2.namefrom list l1inner join list l2on l1.address = l2.addresswhere l1.name < l2.name
I meat both listed names appeared in the same table 1, not in separate list. I put list 1, and 2 upthere to distingish 2 differrent spelling. So it won't work with your query. Thanks, |
 |
|
|
bjoerns
Posting Yak Master
154 Posts |
Posted - 2008-09-08 : 12:36:07
|
| It works, because the same list has two different aliases (l1 and l2). I think that is called a self-join.Bjoern |
 |
|
|
ntn104
Posting Yak Master
175 Posts |
Posted - 2008-09-08 : 13:14:18
|
quote: Originally posted by bjoerns It works, because the same list has two different aliases (l1 and l2). I think that is called a self-join.Bjoern
I will try and inform you the result...Thanks very much! |
 |
|
|
ntn104
Posting Yak Master
175 Posts |
Posted - 2008-09-08 : 14:29:21
|
quote: Originally posted by ntn104
quote: Originally posted by bjoerns It works, because the same list has two different aliases (l1 and l2). I think that is called a self-join.Bjoern
The query work but how can we only show one unique name?Here is my sample result:AARON S FRIEDMAN STE 355 PHILA PA 19103 AARON S FRIEDMAN STE 355 PHILA PA 19103 AARON S FRIEDMAN STE 355 PHILA PA 19103 AARON S FRIEDMANN STE 355 PHILA PA 19103 and the last one is the correct name. Thanks,
|
 |
|
|
blindman
Master Smack Fu Yak Hacker
2365 Posts |
Posted - 2008-09-08 : 14:40:54
|
| There is absolutely no way SQL can tell you which is the "correct" name.Even in your example, I would have bet that "AARON S FRIEDMAN" was the correct name because it appears three times, while "AARON S FRIEDMANN" appears only once.Boycotted Beijing Olympics 2008 |
 |
|
|
ntn104
Posting Yak Master
175 Posts |
Posted - 2008-09-09 : 12:02:53
|
quote: Originally posted by blindman There is absolutely no way SQL can tell you which is the "correct" name.Even in your example, I would have bet that "AARON S FRIEDMAN" was the correct name because it appears three times, while "AARON S FRIEDMANN" appears only once.Boycotted Beijing Olympics 2008
I guess I have to manually to delete names that I makes sense.Thanks all! |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2008-09-09 : 12:41:04
|
You want to manually delete records that makes sense?Huh? E 12°55'05.63"N 56°04'39.26" |
 |
|
|
jordanam
Yak Posting Veteran
62 Posts |
Posted - 2008-09-09 : 13:12:45
|
| Yes, at some point it would seem a human has to look at the record to decide which is the correct one. The fuzzy match still helps you though. Instead of wiping out records programmatically (and arbitrarily), you could output a list of similar records and give that entire list to a human, assuming this is a regular process that needs to run.Just a thought. |
 |
|
|
|