I'm new to SQL Datetime.
Considering I have records in MySQL with Datetime data (as seen below), what is the best way to get the most frequent occurring HOUR or range/period for these records for a particular user (i.e. john)?
ID | Datetime | User | Activity
0 2010-03-29 13:15:56 john visit
1 2010-03-29 13:13:14 ariel visit
2 2010-03-29 13:09:13 john visit
3 2010-03-29 13:07:21 john visit
4 2010-02-23 12:21:03 john visit
5 2010-02-23 12:01:03 john visit
6 2010-02-23 11:01:03 john visit
7 2010-02-23 02:01:03 john visit
With the above data, the frequent hour for john doing visit would be 13, while period would be perhaps 12-13.
The goal is to find the period/time that the user does a certain activity most.
Thanks in advance for all the help!