Changes between Version 3 and Version 4 of Ticket #35437, comment 2


Ignore:
Timestamp:
May 6, 2024, 6:54:44 PM (6 months ago)
Author:
Simon Charette

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #35437, comment 2

    v3 v4  
    4949)
    5050}}}
     51
     52Or a window function
     53
     54{{{#!python
     55Employee.objects.annotate(
     56    highest_paid_id=Window(
     57        FirstValue("id"),
     58        partition_by="manager",
     59        order_by="-salary",
     60    )
     61).filter(id=F("highest_paid_id"))
     62}}}
Back to Top