title: Addition of DISTINCT clause in SQL returning wrong values
body: <p>A bit of background: I'm working for an organization with a large number of users running reports in excel. Often they require macros which compare two sets of data against each other. A large portion of my work involves tuning specific change report macros. Not pretty, but it pays the bills.</p>
  
  <p>I had an idea today to pull excel tables into an ADODB object in vba and then run SQL against the object. Everything seemed to work well... but then I came across odd behavior.</p>
  
  <p>This returns all the names in table1 where a.Name isn't in table2. And it works fine, but some of the names come up multiple times.</p>
  
  <pre><code>SELECT a.Name FROM [Table1] AS a
  LEFT JOIN [Table2] AS b
  ON a.Name = b.Name
  WHERE b.Name IS NULL
  </code></pre>
  
  <p>Adding a DISTNCT clause:</p>
  
  <pre><code>SELECT DISTINCT a.Name FROM [Table1] AS a
  LEFT JOIN [Table2] AS b
  ON a.Name = b.Name
  WHERE b.Name IS NULL
  </code></pre>
  
  <p>Completely changes which names appear. What shows up is DISTINCT, but present in both tables.</p>
  
  <p>I tried rewording it a s a GROUP BY to replace the distinct value and recieved the same results. I checked with the local guru and got no where. Next step is to install a real database here to run some tests on.</p>
  
  <p>I'm perplexed though.</p>