Answer the question
In order to leave comments, you need to log in
How to make a sample of lost customers?
There is a database with all orders phone, id, price, accept
, the client's phone number, order ID, order amount, date-time of the order.
You need to make a selection (unique phone numbers) for customers who:
Answer the question
In order to leave comments, you need to log in
SELECT `phone`, count(`id`) as `count`
FROM `orders`
WHERE `accept` >= NOW() - INTERVAL 120 DAY AND `accept` <= NOW() - INTERVAL 30 DAY
GROUP BY `phone`
HAVING `count` >= 2
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question