I need to collect only the extreme 'id' values for each given time range. According to the data below, I need to collect the ids 63 and 67 for the time of 00:45:22, 80 and 84 for the time of 01:15:26. How to proceed?
id n hora data AP
63 5 00:45:22 24/05/2017 3
64 5 00:45:22 24/05/2017 1
65 5 00:45:22 24/05/2017 3
66 5 00:45:22 24/05/2017 3
67 5 00:45:22 24/05/2017 3
80 5 01:15:26 24/05/2017 5
81 5 01:15:26 24/05/2017 5
82 5 01:15:26 24/05/2017 5
83 5 01:15:26 24/05/2017 5
84 5 01:15:26 24/05/2017 5