Changes between Initial Version and Version 1 of Ticket #35437, comment 2


Ignore:
Timestamp:
May 6, 2024, 6:45:42 PM (6 months ago)
Author:
Simon Charette

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #35437, comment 2

    initial v1  
    3939         q.add_annotation(Value(1), "a")
    4040}}}
     41
     42This appears to be a misuse of `EXISTS` here. You want to a subquery directly I suppose to achieve your purpose.
     43
     44{{{#!python
     45Employee.objects.filter(
     46    id__in=Employee.objects.filter(
     47        manager=OuterRef("manager")
     48    ).order_by("-salary").values("id")
     49)
     50}}}
Back to Top