# Thread: Calculating New vs Returning Customer Orders

1. ## Calculating New vs Returning Customer Orders

Hi all, I'm trying to pick my brains on how I can work out a percentage so I would know how many customers are new or returning. I can see customers who have more than one order but not sure how else I can do this, I'm sure it's pretty simple!

Code MySQL:
`SELECT customers_id, customers_name, COUNT(*) AS occur FROM orders GROUP BY customers_id HAVING(occur)>1 ORDER BY occur DESC`

2. how do you know a customer is a returning customer?

versus a new customer who places two orders on her first visit?

3. Hi, a customer has to firstly create an account and I then store that account number in a column in the order table...

4. Originally Posted by coxdabd
Hi, a customer has to firstly create an account and I then store that account number in a column in the order table...
so...

when you store that customer number into the first order created by that customer, it's a new customer, right?

and when you store that customer number into the second order created by that customer, it's not a new customer, right?

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•