Annotate Unique Distinct

[Solved] Annotate Unique Distinct | Perl - Code Explorer | yomemimo.com
Question : .annotate unique distinct

Answered by : trained-tuna

# Count Avg Sum etc. take a distinct argument for finding unique values
p = Project.objects.all().annotate(Count('unit__name', distinct=True))

Source : https://stackoverflow.com/questions/13145254/django-annotate-count-with-a-distinct-field | Last Update : Tue, 18 Jan 22

Question : .annotate unique distinct

Answered by : frightened-fish-uwllro3wuedb

p = Project.objects.all().annotate(Count('informationunit__username', distinct=True))

Source : https://w3programmers.org/questions/13145254/Django-annotate-count-with-a-distinct-field | Last Update : Thu, 03 Mar 22

Answers related to annotate unique distinct

Code Explorer Popular Question For Perl