In the last few weeks I tried to make the "group by" clause work properly, but after applying patches and upgrades I'm still unable to build the proper query by UI.
For what I understand what is not working in the sql is that the field on which I'm doing the SUM is also in the GROUP BY clause so equal numbers are summed but different are not.
So now I'm trying to modify this last bit by hand. I was hoping that by intercepting $query with hook_views_query_alter() I could be able to take the GROUP BY clause, strip out the unnecessary field, and let it go back into the stream.
The problem is that I can't see how to do that, the $query object I find has no Group By clause. Where should I look?
PASSED: [[SimpleTest]]: [MySQL] 1,603 pass(es).
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch views-enable_groupby_in_query-1270064-9.patch. Unable to apply patch. See the log in the details link for more information.
FAILED: [[SimpleTest]]: [MySQL] 561 pass(es), 47 fail(s), and 70 exception(s).
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch 1270064_views_plugin_query_default.patch. Unable to apply patch. See the log in the details link for more information.