I have a view that uses a Relationship and Aggregation. My View is working; however, I don't understand how/if I can fix the Query to remove redundant GROUP BY fields. Here's a summary of what I have:
I've created a View with Child items, which have an entity reference field parent_id that I use to create a relationship to Parent items. Each child has four integer quantity fields. Each row should display three text fields from the parent entity and then the SUM of each of the four quantity fields. I use the Aggregation settings on each of the quantity fields to get the SUMs. That works fine. I use "Group results together" for the target_id of the parent_id, which also works fine. What I don't understand is what to do for the other parent entity text fields. It seems that the only option is to use "Group results together" for the aggregation type for each. However, that results in a query with a bunch of extra GROUP BY criteria. I'd like my criteria to look like this:
GROUP BY child_entity_parent_id
instead of this:
GROUP BY child_entity_parent_id, parent_entity_title_field, parent_entity_description_field, parent_entity_size_field
Is there anything I can do to get those redundant fields out of the group by or do I just ignore them since they're not really hurting anything? Everything else in the query looks good.
(This is Drupal 8, if it matters.)