title: unexpected sql query behavior. (DISTINCT)
body: <pre><code>select DISTINCT(user),host from logins where ip in (
  SELECT ip FROM logins group by ip HAVING COUNT(user) &gt; 1)
  </code></pre>
  
  <p>This works fine.</p>
  
  <pre><code>select DISTINCT(user),host,time from logins where ip in (
  SELECT ip FROM logins group by ip HAVING COUNT(user) &gt; 1)
  </code></pre>
  
  <p>By adding the time column it no longer selects distinct users and returns duplicates. Why does it do that? It only seems to happen when I add integner fields (id and time for example).</p>
  
  <p>The query basically pulls users from the logins table with conficting IPs. One user should not be pulled more than once.</p>