Fix for Weird Views2 sql for relationship

  1. SELECT node.nid AS nid,
  2.    node.title AS node_title,
  3.    node_data_field_pubmed_id.field_pubmed_id_value AS node_data_field_pubmed_id_field_pubmed_id_value,
  4.    node.type AS node_type,
  5.    node.vid AS node_vid,
  6.    node.created AS node_created,
  7.    node_node_data_field_recap_nid_node_data_field_date_published.field_date_published_value AS node_node_data_field_recap_nid_node_data_field_date_published_field_date_published_value,
  8.    node_node_data_field_recap_nid.nid AS node_node_data_field_recap_nid_nid,
  9.    node_node_data_field_recap_nid.type AS node_node_data_field_recap_nid_type,
  10.    node_node_data_field_recap_nid.vid AS node_node_data_field_recap_nid_vid
  11.  FROM node node
  12.  LEFT JOIN content_type_pubmed node_data_field_recap_nid ON node.vid = node_data_field_recap_nid.vid
  13.  LEFT JOIN node node_node_data_field_recap_nid ON node_data_field_recap_nid.field_recap_nid_nid = node_node_data_field_recap_nid.nid
  14.  LEFT JOIN content_type_paper node_data_field_pubmed_id ON node.vid = node_data_field_pubmed_id.vid
  15.  LEFT JOIN content_type_pubmed node_node_data_field_recap_nid_node_data_field_date_published ON node_node_data_field_recap_nid.vid = node_node_data_field_recap_nid_node_data_field_date_published.vid
  16.  WHERE (node.type in ('paper')) AND (node.status <> 0)
  17.    ORDER BY node_created DESC

Submit Fix

Any tags you'd like to associate with your code, delimitered by commas (example: Views, CCK, Module, etc).
Select the syntax highlighting mode to use.