#28296: Subquery with annotation fails without tweaking
-------------------------------------+-------------------------------------
               Reporter:  László     |          Owner:  nobody
  Károlyi                            |
                   Type:  Bug        |         Status:  new
              Component:  Database   |        Version:  1.11
  layer (models, ORM)                |
               Severity:  Normal     |       Keywords:
           Triage Stage:             |      Has patch:  0
  Unreviewed                         |
    Needs documentation:  0          |    Needs tests:  0
Patch needs improvement:  0          |  Easy pickings:  0
                  UI/UX:  0          |
-------------------------------------+-------------------------------------
 Hey guys,

 after having spent a couple of hours figuring out why a subquery annotated
 with `Count` fails, I came to the conclusion that `Count` in a query
 causes `GROUP BY` clauses added to it, which in turn renders the SQL
 subquery useless.

 Please investigate this example which I just added to Stack Overflow as a
 resolution, and see what I'm talking about:

 https://stackoverflow.com/a/44474268/1067833

--
Ticket URL: <https://code.djangoproject.com/ticket/28296>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/050.44c2c9b3e0ee36d537838b4759ba710b%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to