title: SQL Server : INNER JOIN returning incorrect row
body: <p>I have two tables <code>Person</code> and <code>Table1</code>. I want to join the <code>person</code> table to <code>table1</code> where the <code>foodId</code> is 2. </p>
  
  <p>However, when I do the inner join it is only joining the record where <code>foodId</code> is 1.</p>
  
  <p><code>Person</code>:</p>
  
  <pre><code>id      fName      lName
  1       John       Smith
  </code></pre>
  
  <p><code>Table1</code>:</p>
  
  <pre><code>id      personId      foodId     date
  1       1             1          2014-10-28
  2       1             2          2014-10-28
  </code></pre>
  
  <p>The query I tried is:</p>
  
  <pre><code>SELECT *
  FROM Person p
  INNER JOIN Table1 t ON p.id = t.personId AND foodId = 2
  </code></pre>
  
  <p>I also tried:</p>
  
  <pre><code>SELECT *
  FROM Person p
  INNER JOIN Table1 t ON p.id = t.personId 
  WHERE t.foodId = 2
  </code></pre>
  
  <p>Both of those queries show empty results.</p>
  
  <p>Any suggestions would be appreciated!</p>