Index: plugins/views_plugin_query_default.inc
===================================================================
--- plugins/views_plugin_query_default.inc
+++ plugins/views_plugin_query_default.inc
@@ -1243,7 +1243,7 @@
     if (count($this->having)) {
       $this->has_aggregate = TRUE;
     }
-    if ($this->has_aggregate && (!empty($this->groupby) || !empty($non_aggregates))) {
+    if (!empty($this->groupby) || !empty($non_aggregates)) {
       $groupby = array_unique(array_merge($this->groupby, $non_aggregates));
       foreach ($groupby as $field) {
         $query->groupBy($field);
