in reply to To find the no of occurenaces and max min value

Good grief, let’s just strip this down to SQL, because that’s all you need to do:

SELECT
  MIN(Time_Taken) AS Minimum,
  MAX(Time_Taken) AS Maximum,
  COUNT(DISTINCT Person_ID) AS Number_of_Occur
FROM ...
GROUP BY person_id

Sounds rather suspiciously like homework to me, because a trivial Pure-SQL solution does exist.