Answers for "SELECT DISTINCT ON expressions must match initial ORDER BY expressions django"

0

SELECT DISTINCT ON expressions must match initial ORDER BY expressions django

from django.db.models import Subquery

Model.objects.filter(
    pk__in=Subquery(
       Model.objects.all().distinct('foo').values('pk')
    )
).order_by('bar')
Posted by: Guest on November-20-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language