Solved

Find a duplicate field in 2 or more records

Posted on 2013-01-09
3
546 Views
Last Modified: 2013-01-10
What I have is a database of club members. There may be more than one member at the same household address. There are times when I want to send a mailing to only one member of the household instead of all.

The field in this case is Address. I want my result set to only include one member at that Address to receive the mailing. It does not have to be a specific member. I need the first occurrence and ignore the rest at that Address.

I am looking for a SQL statement that can give the results I want. I tried Distinct, but that applies to the row, not a single field. I believe that is true. Group By does not seem to work either.

Anyone know how to do this?
0
Comment
Question by:dmathews63
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 41

Accepted Solution

by:
ralmada earned 500 total points
ID: 38760739
this will give you one member per address

select Address, max(memberID)
from yourtable
group by Address
0
 
LVL 32

Expert Comment

by:awking00
ID: 38760861
What dbms are you using?
0
 

Author Comment

by:dmathews63
ID: 38762771
The post by ralmada gave me what I needed. I was trying something similar, but was missing something. This solution appears to be doing what I want.

Thanks everyone,
Dick
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Read about achieving the basic levels of HRIS security in the workplace.
Never store passwords in plain text or just their hash: it seems a no-brainier, but there are still plenty of people doing that. I present the why and how on this subject, offering my own real life solution that you can implement right away, bringin…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question