Skip to main content
deleted 42 characters in body
Source Link

I have a contacts table that is like this:

|id|first_name|last_name|date_entered|

then, I have a table that storedstores the email addresses like this:

|id|email_address|

I then have a relational table that joins the two tables above together like this:

|id|contact_id|email_id|

What I am trying to figure out is, how do I get a count of all new contacts that has been entered in between 2023-02-10 and 2023-02-13 and then, how do I get a count of the same data but but only the contacts that have matching emails?

For example, a new contact is entered in the db with the email of [email protected]. A few days later, that same contact comes back and is entered in by another person but with the same email address of [email protected].

I am building a report of "New vs Returning Customers" and we useruse their email to identify a customer that is returning. So, I am needing to be able to list a count of all customers in the database with the same email that is > 1. Is this possible with MySQL? Thanks!

I have a contacts table that is like this:

|id|first_name|last_name|date_entered|

then, I have a table that stored the email addresses like this:

|id|email_address|

I then have a relational table that joins the two tables above together like this:

|id|contact_id|email_id|

What I am trying to figure out is, how do I get a count of all new contacts that has been entered in between 2023-02-10 and 2023-02-13 and then, how do I get a count of the same data but only the contacts that have matching emails?

For example, a new contact is entered in the db with the email of [email protected]. A few days later, that same contact comes back and is entered in by another person but with the same email address of [email protected].

I am building a report of "New vs Returning Customers" and we user email to identify a customer that is returning. So, I am needing to be able to list a count of all customers in the database with the same email that is > 1. Is this possible with MySQL? Thanks!

I have a contacts table that is like this:

|id|first_name|last_name|date_entered|

then, I have a table that stores the email addresses like this:

|id|email_address|

I then have a relational table that joins the two tables above together like this:

|id|contact_id|email_id|

What I am trying to figure out is, how do I get a count of all new contacts that has been entered in between 2023-02-10 and 2023-02-13 but only the contacts that have matching emails?

For example, a new contact is entered in the db with the email of [email protected]. A few days later, that same contact comes back and is entered in by another person but with the same email address of [email protected].

I am building a report of "New vs Returning Customers" and we use their email to identify a customer that is returning. So, I am needing to be able to list a count of all customers in the database with the same email that is > 1. Is this possible with MySQL? Thanks!

Source Link

Get count of contacts with email addresses that matches other contacts in same tables

I have a contacts table that is like this:

|id|first_name|last_name|date_entered|

then, I have a table that stored the email addresses like this:

|id|email_address|

I then have a relational table that joins the two tables above together like this:

|id|contact_id|email_id|

What I am trying to figure out is, how do I get a count of all new contacts that has been entered in between 2023-02-10 and 2023-02-13 and then, how do I get a count of the same data but only the contacts that have matching emails?

For example, a new contact is entered in the db with the email of [email protected]. A few days later, that same contact comes back and is entered in by another person but with the same email address of [email protected].

I am building a report of "New vs Returning Customers" and we user email to identify a customer that is returning. So, I am needing to be able to list a count of all customers in the database with the same email that is > 1. Is this possible with MySQL? Thanks!