title: Django ORM more than one row returned by a subquery used as an expression
body: <p>My Subquery behaves differently on different machines.
  Subquery looks like:</p>
  <pre><code>Sale.objects.filter(object_id=OuterRef(&quot;id&quot;), is_canceled=False)
  .values(&quot;object&quot;)
  .annotate(total_amount=Coalesce(Sum(&quot;amount&quot;), 0))
  .values(&quot;total_amount&quot;) 
  </code></pre>
  <p>On my local machine I have 3 Sale instances and the result of the query is:</p>
  <pre><code>&lt;QuerySet [{'object': 1, 'total_amount': 210}]&gt;
  </code></pre>
  <p>On my dev machine I have 2 Sale instances and the result of a call looks like this:</p>
  <pre><code>&lt;QuerySet [{'object': 100, 'total_amount': 20}, {'object': 100, 'total_amount': 10}]&gt;
  </code></pre>
  <p>I checked the query Django ORM generates in both cases and it looks the same</p>
  <pre><code>SELECT &quot;object_sale&quot;.&quot;object_id&quot;, COALESCE(SUM(&quot;object_sale&quot;.&quot;amount&quot;), 0) AS &quot;total_amount&quot;
  FROM &quot;object_sale&quot; 
  WHERE (&quot;object_sale&quot;.&quot;object_id&quot; = 1) 
  GROUP BY &quot;object_sale&quot;.&quot;object_id&quot;, &quot;object_sale&quot;.&quot;price&quot; 
  ORDER BY &quot;object_sale&quot;.&quot;price&quot; ASC
  </code></pre>