There is a database with online store customers, which has the following data:
- id buyer’s;
- order number;
- date and time of the order;
- order amount.
Data on customers and orders for 3 months.
How to withdraw customers who made more than 1 order per day and in the range of 3 hours of any day.
Is it possible to do this with a single query, or is it necessary to check each three-hour range manually?
For example, the buyer id 10321630 made 5 orders, on May 26, in the period from 19:00 to 22:00 (19:15, 19:37, 19:51, 21:07, 21:18) It is necessary that it be in the output of the query result.
I found tips on the Internet only about “between”, but this is not exactly the case
xSPIRICx is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.