擅长:python、mysql、java
<p>参见<a href="https://docs.djangoproject.com/en/dev/topics/db/aggregation/#aggregating-annotations" rel="nofollow">https://docs.djangoproject.com/en/dev/topics/db/aggregation/#aggregating-annotations</a>中的示例:</p>
<pre><code> Book.objects.annotate(num_authors=Count('authors')).filter(num_authors__gt=1)
</code></pre>