select agent,max(id) into agent_id from tracker group by agent