Tuesday, September 13, 2011

Re: order by + group by

What are you trying to do? The outer GROUP BY destroys the inner ORDER BY. Try putting them on the same level and see what happens.

On Sep 11, 2011, at 3:41 AM, Jonas H. wrote:

> Hi!
>
> How can I express this SQL query
>
> SELECT ... FROM (
> SELECT ... FROM ...
> )
>
> in the ORM? Specifically, I want to express
>
> SELECT ... FROM (
> SELECT ... FROM app_model
> ORDER BY field1
> )
> GROUP BY field2
>
> Is it possible without writing SQL by hand?
>
> Thanks,
> Jonas

Peter of the Norse
RahmCoff@Radio1190.org

--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate