title: Getting Odd Results from my SQL Statement(s)
body: <p>I got different results when I repeated the WHERE statement (by mistake).  </p>
  
  <p>Today I was trying to look up how many times some errors were appearing in our system.  I got odd results when I repeated the same WHERE statement by mistake.  I first searched for error code 635 and got 140 returns.  So I attempted to search for two different error codes but mis-typed the second code in question to the same number as in the first WHERE statement, 635, and I got 1058 rows returned.</p>
  
  <p>I'm curious why the 1058 rows didn't return when I only had the WHERE statement once.  I even experimented and repeated the WHERE statement three more times (four total) but the number of rows returned stayed constant at 1058.</p>
  
  <p>I first ran this and got 140 rows returned...</p>
  
  <pre><code>SELECT *
  FROM ErrTbl
  WHERE status = 'unresolved'
  AND ErrCd = '635'
  </code></pre>
  
  <p>Then I wanted to run this...</p>
  
  <pre><code>SELECT *
  FROM ErrTbl
  WHERE status = 'unresolved'
  AND ErrCd = '635'
  OR ErrCd = '735'
  </code></pre>
  
  <p>But I accidentally ran this and got 1058 rows returned...</p>
  
  <pre><code>SELECT *
  FROM ErrTbl
  WHERE status = 'unresolved'
  AND ErrCd = '635'
  OR ErrCd = '635'
  </code></pre>
  
  <p>If I accidentally repeated the same WHERE statement I would expect the returned rows to be the same, in this case 140.  Actually, looking at the returns it should have been 1058 for each case.</p>
  
  <p>I'm not sure why the difference.</p>