I want to list min time and max time of a day in for each users from the below table.
How to fetch records like below.
Expected result:
user_id FROM TO
-------- ------------------- -------------------
6 2015-01-22 11:30:51 2015-01-22 16:30:51
17 2015-01-22 11:59:31 2015-01-22 11:59:31
17 2015-01-30 05:52:30 2015-01-30 06:07:47