Eliminating records with duplicate fields, but not duplicate rows

  • Thread starter Thread starter robert_dickey
  • Start date Start date
R

robert_dickey

If I have two tables, A and B, with unique IDs in table A and
duplicate matching IDs in table B, how do I write a query to pull out
only one of the matching IDs in table B? Assume that the ID is the
key field in both tables. For example, in Table A, I have an ID =
999. I have four occurences of 999 in Table B. All I want from
table B is the address associated with 999. So in my query, I want
to match only one of the four records in Table B with the ID = 999.

I have tried this using select distinct, but if I try to include any of
the other fields in Table B besides the ID field, I get all of the
matching records in Table B.

Thanks,
Bob
 
Try using Sumary Query,
In the Total row, set:
- Group by for IDs in table A
- First for all included fields in table B
Hope this help.
 
Back
Top