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


Ignore:
Timestamp:
Oct 3, 2024, 6:01:07 PM (6 weeks ago)
Author:
Simon Charette

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #35810, comment 2

    initial v1  
    99    Select(
    1010        "messages",
    11         queryset=Message.objects.order_by("created_at"),
     11        queryset=Message.objects.order_by("created_at")[0],
    1212        to_attr="lastest_message",
    1313    ),
     
    1919    chat.*,
    2020    latest_message.*
     21FROM chat
    2122LEFT JOIN LATERAL (
    2223    SELECT *
     
    3435    lastest_message=Message.objects.filter(
    3536       chat_id=OuterRef("id"),
    36    ).order_by("created_at")[1]
     37   ).order_by("created_at")[0]
    3738)
    3839}}}
Back to Top