Eliminating records with duplicate fields, but not duplicate rows

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
 
G

Guest

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top