Skip to content
Advertisement

MySQL 5: How to find the peak of customers during working time

I have table in MySQL with times spent by customers and I need to find the most busy 30 mins.

Expected result is something like multiplerows with time and number of customers:

I can easily make 5 sql queries and get the result (I made some view in similar problem https://stackoverflow.com/a/59478411/11078894 ), but I do not know how to get the result with 1 query.

Please how to make subintervals in MySQL? Thx

Advertisement

Answer

Thanks to the post from GMB I found the solution also for the SQL 5 Some view:

After the view is created:

Result:

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement