0

Good Morning,

I have an ever growing member database that is currently at around 6000 (developed over the past 2 weeks), and expect it to be in the hundreds of thousands within a few more weeks...

My problem is that alot of members are using a single email address for multiple members, and I would like to limit the emails that we send out to just 1 per email address to save on the email load and time...

Here is my query:

SELECT user, pass, email
        FROM members
        WHERE mem_status <>'T'
        ORDER BY email asc";

What do I need to do to not send multiple emails to the same address...

Thank you in advance for your feedback.

I'm sure it is something simple that I should know, but I'm finding every day that there is alot I still don't know about programming, expecially when it comes to MySql...

Douglas

3
Contributors
3
Replies
4
Views
5 Years
Discussion Span
Last Post by showman13
0

If you are trying to target the unique email accounts, rather than the user, then change your query to something like:

SELECT distinct(email)
FROM members
WHERE mem_status <>'T'

This query will only provide you with a result of unique email addresses.

0

or

SELECT user, pass, email, count(*) as `num_accounts`
        FROM members
        WHERE mem_status <>'T'
        GROUP BY email
        ORDER BY email asc";
0

Biiim,

Thank you... That was exactly the answer I was looking for, and in reality, I should have known the answer.

I appreciate your response, and adding the count was a great idea, as I am implementing that into the email that is being sent telling them that the single email cover all XXX accounts that they have listed under the single email address.

Thanks again,

Douglas

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.