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!

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

how do you know a customer is a returning customer?

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

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?

sounds like you answered your own question

:slight_smile: