title: Django: remove GROUP BY added with extra() method?
body: <p>Hi (excuse me for my bad english) !</p>
  
  <p>When I make this:</p>
  
  <pre><code>gallery_qs = Gallery.objects.all()\
                      .annotate(Count('photos'))\
                      .extra(select={'photo_id': 'photologue_photo.id'})
  </code></pre>
  
  <p>The sql query is :</p>
  
  <pre><code>SELECT (photologue_photo.id) AS `photo`, `photologue_gallery`.*
  FROM `photologue_gallery` 
      LEFT OUTER JOIN `photologue_gallery_photos` 
        ON (`photologue_gallery`.`id` = `photologue_gallery_photos`.`gallery_id`) 
      LEFT OUTER JOIN `photologue_photo` 
        ON (`photologue_gallery_photos`.`photo_id` = `photologue_photo`.`id`) 
  GROUP BY `photologue_gallery`.`id`, photologue_photo.id 
  ORDER BY `photologue_gallery`.`publication_date` DESC
  </code></pre>
  
  <p>The problem is that <code>extra</code> method automatically adds photologue_photo.id in GROUP BY clause. And I need remove it, because it duplicates galleries, for example :</p>
  
  <pre><code>[&lt;Gallery: Lorem ipsum dolor sit amet&gt;, &lt;Gallery: Lorem ipsum dolor sit amet&gt;, &lt;Gallery: Lorem ipsum dolor sit amet&gt;, &lt;Gallery: Lorem ipsum dolor sit amet&gt;, &lt;Gallery: Lorem ipsum dolor sit amet&gt;, &lt;Gallery: Lorem ipsum dolor sit amet&gt;, &lt;Gallery: Lorem ipsum dolor sit amet&gt;]
  </code></pre>
  
  <p>Si I need to make this query with django, is it possible ?</p>
  
  <pre><code>SELECT (photologue_photo.id) AS `photo`, `photologue_gallery`.*
  FROM `photologue_gallery` 
      LEFT OUTER JOIN `photologue_gallery_photos` 
        ON (`photologue_gallery`.`id` = `photologue_gallery_photos`.`gallery_id`) 
      LEFT OUTER JOIN `photologue_photo` 
        ON (`photologue_gallery_photos`.`photo_id` = `photologue_photo`.`id`) 
  GROUP BY `photologue_gallery`  
  ORDER BY `photologue_gallery`.`publication_date` DESC
  </code></pre>
  
  <p>Thank you ! :)</p>