title: How correctly perform a query that JOIN 2 tables using 2 differents fields that are into these tables?
body: <p>I am pretty new in SQL and I have the following problem with a simple query.</p>
  
  <p>I have to perform a query that <strong>JOIN</strong> 2 tables. The join operation is not on a single field but have to be performed on 2 differents field having the same name on these tables.</p>
  
  <p>So I have done something like this:</p>
  
  <pre><code>SELECT count(*) 
  FROM TID003_ANAGEDIFICIO anagraficaEdificio 
  INNER JOIN TID002_CANDIDATURA candidatura ON(candidatura.PRG_PAR = anagraficaEdificio.PRG_PAR, candidatura.PRG_CAN = anagraficaEdificio.PRG_CAN)
  WHERE anagraficaEdificio.FLG_GRA=1;
  </code></pre>
  
  <p>But, performing this query, I obaint the following error message:</p>
  
  <blockquote>
    <p><strong>Operand should contain 1 column(s)</strong></p>
  </blockquote>
  
  <p>As you can see I am trying to join these 2 tables and the join is based on 2 fields, by:</p>
  
  <pre><code>ON(candidatura.PRG_PAR = anagraficaEdificio.PRG_PAR, candidatura.PRG_CAN = anagraficaEdificio.PRG_CAN)
  </code></pre>
  
  <p>What is wrong? What am I missing? How can I fix this issue?</p>