I have a query that gives me the count of an instance based on the latest timestamp. The original table looks like this:
+--------------+---------------------