>>You can get duplicates for several reasons.
>>
>>1) If one table has 3 copies on the matching field, and the other 4, you will get 3*4=12 duplicates in the result set.
>>...
>Yes, the 1) case.
>
>I want result is 1-by-1 matching, once match, skip it..
>but both side data may missing...
>
>What should I do?
>Thanks
Two solutions:
a) Eliminate the duplicates with a condition. For instance, if it is caused by empty records on both sides, add the clause
WHERE NOT EMPTY(table1.KeyField) AND NOT EMPTY(table2.KeyField)b) Joins are often done on primary keys / foreign keys. Make sure the PK is really unique.
Hilmar.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)