On Fri, Oct 30, 2009 at 22:10, Javier Guerra <jav...@guerrag.com> wrote:
> > On Fri, Oct 30, 2009 at 4:05 PM, TiNo <tin...@gmail.com> wrote: > > SQL's GROUP BY is made for this isn't it? > > no, it's not. > > SQL's GROUP BY discards 'individual' rows off the result, showing only > 'grouping' rows. > Oops, too quick. You might be able to do it with GROUP_CONCAT[1] if you are on MySQL. You would have to write raw sql though. That way you don't have to load all the results into memory, but you could just split the string of id's per result. Tino [1] http://dev.mysql.com/doc/refman/5.0/en/group-by-functions.html#function_group-concat <http://dev.mysql.com/doc/refman/5.0/en/group-by-functions.html#function_group-concat> --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---