Select id and latest time