I am trying to get a list of car makes from my list of car profiles, so I selected to group make and count nid, but the query that results is as follows:
SELECT node_data_field_make.field_make_value AS node_data_field_make_field_make_value, node.type AS node_type, node.nid AS nid, node.vid AS node_vid, COUNT(node.nid) AS nid_1 FROM node node LEFT JOIN content_type_car_profile node_data_field_make ON node.vid = node_data_field_make.vid
WHERE node.type in ('car_profile')
GROUP BY node_data_field_make_field_make_value, node_type, nid, node_vid
It results in:
Alfa Romeo
count: 1
Alfa Romeo
count: 1
etc, where it should just be:
Alfa Romeo
count: 2
when i run the query on the db and remove nid, node_vid from the group by, it returns the results that I would expect.
Any ideas?
Comments
No answers, but I'm having
No answers, but I'm having the same problem. Is the issue that Views 3 doesn't let us NOT select the 'group by' when grouping is enabled?
me too
I'm having the same problem on D7.0, trying to display just one image from a list of images in a node. I also tried the solution outlined here:
http://drupal.org/node/622944#comment-3648122
But got the same problem, displaying the nodes multiple times, with their full list of images, rather than just the first image.
This is a known problem which
This is a known problem which is difficult to solve. Check my summary with links, and merlin's response here:
http://drupal.org/node/1037110#comment-4012714
Cheers,
Achton