title: Drupal Views:Add condition in where clause where the value is a field in hook_alter_query
body: <p>I am trying to add a condition to a query like:</p>
  
  <p>civicrm_contact_civicrm_relationship.id &lt;> civicrm_contact_civicrm_relationship_1.id</p>
  
  <p>but for the second field drupal takes it as a string so it always result into </p>
  
  <p>civicrm_contact_civicrm_relationship.id &lt;> 'civicrm_contact_civicrm_relationship_1.id'</p>
  
  <p>I've tried to play with the numerical value with no success. </p>
  
  <p>Any idea how can I do this? May be with another hook? any tip will be welcome!</p>
  
  <p>My code:</p>
  
  <pre><code>        $view-&gt;query-&gt;where[2]["conditions"][0]["field"] = "civicrm_contact_civicrm_relationship_1.id";
          $view-&gt;query-&gt;where[2]["conditions"][0]["operator"] = "IS NULL";
          $view-&gt;query-&gt;where[2]["conditions"][0]["value"] = "";
  
          $view-&gt;query-&gt;where[2]["conditions"][1]["field"] = "civicrm_contact_civicrm_relationship.id";
          $view-&gt;query-&gt;where[2]["conditions"][1]["operator"] = "IS NULL";
          $view-&gt;query-&gt;where[2]["conditions"][1]["value"] = "";
  
          $view-&gt;query-&gt;where[2]["conditions"][2]["field"] = "civicrm_contact_civicrm_relationship.id";
          $view-&gt;query-&gt;where[2]["conditions"][2]["value"] ="civicrm_contact_civicrm_relationship_1.id";
          $view-&gt;query-&gt;where[2]["conditions"][2]["numeric"] = "1";
          $view-&gt;query-&gt;where[2]["conditions"][2]["operator"] = "&lt;&gt;";
  
          $view-&gt;query-&gt;where[2]["type"] = "OR";
  </code></pre>