I need a solution to group the times of entry and the display the respective time interval and count of users/records during that time interval eg
Time Interval Count
07:00 AM-07:30 24
12:30 PM-13:00 26
How can we group time based on interval in Java or SQL
I tried group by in sql and LocalTime grouping by using streams But i m not able to segregate based on the time interval
Time Interval Count
07:00:34 12
12:30:23 14
07:23:53 12
12:46:21 12
I m able to get data in the above format only using sql/java(tried both ways)
Here are the code snippets for classic (algorithmic) approach and the second one that uses java streams api:
Output: