title: SQL limit number of groups
body: <p>I am trying to create a simple pagination but it seems to fail to <code>limit</code> the number of results.</p>
  
  <pre><code>SELECT * FROM visits GROUP by clientID ORDER BY 'date' LIMIT $from, $to
  </code></pre>
  
  <p>I want to get only the first visit (chronologically) of every client and paginate the results.</p>
  
  <p>If I make this query with $from = 6, $to = 12 it returns like 8 rows instead of 7.</p>
  
  <p>What I'm doing wrong?</p>