Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
D
django
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
django
Commits
3d223677
Kaydet (Commit)
3d223677
authored
Ara 08, 2015
tarafından
Tim Graham
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Refs #10060 -- Corrected description of multiple annotations bug.
üst
69b69f6d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
5 deletions
+4
-5
aggregation.txt
docs/topics/db/aggregation.txt
+4
-5
No files found.
docs/topics/db/aggregation.txt
Dosyayı görüntüle @
3d223677
...
@@ -190,9 +190,8 @@ Combining multiple aggregations
...
@@ -190,9 +190,8 @@ Combining multiple aggregations
-------------------------------
-------------------------------
Combining multiple aggregations with ``annotate()`` will `yield the wrong
Combining multiple aggregations with ``annotate()`` will `yield the wrong
results <https://code.djangoproject.com/ticket/10060>`_, as multiple tables are
results <https://code.djangoproject.com/ticket/10060>`_ because joins are used
cross joined. Due to the use of ``LEFT OUTER JOIN``, duplicate records will be
instead of subqueries:
generated if some of the joined tables contain more records than the others:
>>> Book.objects.first().authors.count()
>>> Book.objects.first().authors.count()
2
2
...
@@ -374,8 +373,8 @@ Both queries return a list of publishers that have at least one book with a
...
@@ -374,8 +373,8 @@ Both queries return a list of publishers that have at least one book with a
rating exceeding 3.0, hence publisher C is excluded.
rating exceeding 3.0, hence publisher C is excluded.
In the first query, the annotation precedes the filter, so the filter has no
In the first query, the annotation precedes the filter, so the filter has no
effect on the annotation. ``distinct=True`` is required to avoid a
effect on the annotation. ``distinct=True`` is required to avoid a
:ref:`query
:ref:`cross-join
bug <combining-multiple-aggregations>`.
bug <combining-multiple-aggregations>`.
The second query counts the number of books that have a rating exceeding 3.0
The second query counts the number of books that have a rating exceeding 3.0
for each publisher. The filter precedes the annotation, so the filter
for each publisher. The filter precedes the annotation, so the filter
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment