Drupal Views Duplicate values being returned when using a relationship

Posted by Linda on Stack Overflow See other posts from Stack Overflow or by Linda
Published on 2010-03-24T16:28:41Z Indexed on 2010/03/25 9:33 UTC
Read the original article Hit count: 592

Filed under:
|
|

I am having a problem with views. I have a view and am passing it a taxonomy term by name to it. I then have a relationship to a related node. For my output fields I am returning the related Title and related Body. I however have duplicates in my results. I have turned distinct to yes but believe this is working on the nodes being return and not the related node. Any ideas how I can remove the duplicates?

Update

Below is the query being run when I only get the title

SELECT DISTINCT(node.nid) AS nid,
    node_node_data_field_wine_company.title AS node_node_data_field_wine_company_title,
    node_node_data_field_wine_company.nid AS node_node_data_field_wine_company_nid 
FROM node node  
LEFT JOIN content_type_wine node_data_field_wine_company ON node.vid = node_data_field_wine_company.vid 
INNER JOIN node node_node_data_field_wine_company ON node_data_field_wine_company.field_wine_company_nid = node_node_data_field_wine_company.nid  
LEFT JOIN term_node term_node ON node.vid = term_node.vid INNER JOIN term_data term_data ON term_node.tid = term_data.tid 
WHERE term_data.name = 'test'
GROUP BY nid

It looks like I should be grouping by node_node_data_field_wine_company_nid or selecting distinct values from there. Any ideas?

© Stack Overflow or respective owner

Related posts about drupal

Related posts about drupal-6