title: SQL Inner Join. ON condition vs WHERE clause
body: <p>I am busy converting a query using the old style syntax to the new join syntax. The essence of my query is as follows :</p>
  
  <p>Original Query</p>
  
  <pre><code>SELECT i.*  
  FROM 
    InterestRunDailySum i, 
    InterestRunDetail ird, 
    InterestPayments p
  WHERE 
     p.IntrPayCode = 187
     AND i.IntRunCode = p.IntRunCode AND i.ClientCode = p.ClientCode
     AND ird.IntRunCode = p.IntRunCode AND ird.ClientCode = p.ClientCode
  </code></pre>
  
  <p>New Query</p>
  
  <pre><code>SELECT  i.*
    FROM InterestPayments p
      INNER JOIN InterestRunDailySum i 
        ON (i.IntRunCode = p.IntRunCode AND i.ClientCode = p.ClientCode)
      INNER JOIN InterestRunDetail ird 
        ON (ird.IntRunCode = p.IntRunCode AND ird.IntRunCode = p.IntRunCode)
    WHERE 
      p.IntrPayCode = 187
  </code></pre>
  
  <p>In this example, "Original Query" returns 46 rows, where "New Query" returns over 800</p>
  
  <p>Can someone explain the difference to me? I would have assumed that these queries are identical.</p>