I've got a table of species sightings. I need a query that returns the latest sighting for each species. I believe this would normally require GROUP BY but I am trying to avoid raw SQL.
Could I do the query without the GROUP BY, and then modify the queryset results using Python to eliminate rows except the ones with the latest date for each species? I guess I would use iterator(). But I am not clear on how to use that - there are no examples. With raw SQL it's a headache to get the results in a format that I can pass to a template when I also want to be able to pass normal QuerySets to that same template. Thanks --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---

