Sunday, February 26, 2017

Re: group by 3 fields

On Sun, Feb 26, 2017 at 6:55 AM, Daniel Roseman <daniel@roseman.org.uk> wrote:
> On Sunday, 26 February 2017 11:11:39 UTC, Larry....@gmail.com wrote:
>>
>> Order by is not the same as group by. Group by does aggregation
>>
>
> You should explain what you want to achieve. Grouping is pointless on its
> own. In any case, when working with an ORM like Django's it is generally not
> helpful to think in terms of SQL.

Of course grouping is pointless on its own. I need to do grouping and
aggregation (summing). But I need to group by 3 columns. I don't know
why you say it's not helpful to think in SQL. That is a language I
have worked in for over 20 years, and when I see a querying need that
is how I think, and then I see how can I do that with the ORM. Often I
cannot and have to use raw SQL. But I always do try and see if it can
be done in the ORM.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CACwCsY4NGQwr%3DNHi-STzWj_BYjStwN8ZDK2T-RtoQLU7eCiO%2Bg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment