Changes between Initial Version and Version 1 of Ticket #34413, comment 9


Ignore:
Timestamp:
Mar 13, 2023, 5:53:59 PM (20 months ago)
Author:
Simon Charette

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #34413, comment 9

    initial v1  
    66{{{#!python
    77User.objects.annotate(
    8     first_permission=Permission.objects.filter(
     8    first_permission_id=Permission.objects.filter(
    99        groups__users=OuterRef('pk')
    1010    ).order_by('name')[:1]
     
    1616    user.*,
    1717    (
    18         SELECT permission.*
     18        SELECT permission.id
    1919        FROM permission
    2020        JOIN group_permissions ON (group_permissions.permission_id = permission.id)
     
    2626FROM user
    2727}}}
     28
     29Isn't this report more about the ability of subquery to return more than one column?
Back to Top