title: Is it possible to have 2 limits in a MySQL query?
body: <p>Ok here is the situation (using PHP/MySQL) you are getting results from a large mysql table,
  lets say your mysql query returns 10,000 matching results and you have a paging script to show 20 results per page, your query might look like this</p>
  
  <p><strong>So page 1 query</strong></p>
  
  <pre><code>SELECT column 
  FROM table_name 
  WHERE userId=1 
  AND somethingelse=something else
  LIMIT 0,20
  </code></pre>
  
  <p><strong>So page 2 query</strong></p>
  
  <pre><code>SELECT column 
  FROM table_name 
  WHERE userId=1 
  AND somethingelse=something else
  LIMIT 20,40
  </code></pre>
  
  <p>Now you are grabbing 20 results at a time but there are a total of 10,000 rows that match your search criteria, </p>
  
  <p><strong>How can you only return 3,000 of the 10,000 results and still do your paging of 20 per page with a LIMIT 20 in your query?</strong></p>
  
  <p>I thought this was impossible but myspace does it on there browse page somehow, I know they aren't using php/mysql but how can it be achieved?</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>I see some people have replied with a couple of methods, it seems none of these would actually improve the performance by limiting the number to 3000?</p>