title: Why am I getting a different number of results when I change the formatting of the WHERE statement?
body: <p>I am writing a SQL script (in MySQL Workbench, if that's relevant) that involves looking for variations of the same string in my data. This way, I can get an accurate pull even if something is misspelled. The script goes something like this:</p>
  
  <pre><code>SELECT A.Name, A.ID
  FROM A
  LEFT JOIN B on B.ID = A.ID
  WHERE B.type = 1
  AND (
  B.notes LIKE '%apple%'
  OR B.notes LIKE '%aple%'
  OR B.notes LIKE '%appl%'
  )
  </code></pre>
  
  <p>Because a single entry in table A can be linked to several different notes, which are kept in table B, if a single person has a note that contains "apple" and another that says "appl" they should show up twice, which is fine. After running this script, I got 9627 rows returned.</p>
  
  <p>I tried the same script but changed the WHERE to this:</p>
  
  <pre><code>WHERE B.type = 1
  AND (B.notes LIKE '%apple%'
  OR '%aple%'
  OR '%appl%')
  </code></pre>
  
  <p>and now I have 9929 rows.</p>
  
  <p>Do these two different WHERE clauses function differently because I left out the B.notes in the second? I am working with large data sets (A has over 20,000 entries, B has over 1.6 million) so it's not particularly practical to go through and check all of the data's integrity by hand. I'm fairly new to SQL so I appreciate any information or suggestions as to why this happens and how to get an accurate result.</p>