title: MYSQL use row number in where clause
body: <p>how do I use my row number as part of my where clause?</p>
  
  <p>I have, let say, 25 data and I only want to get first 10 rows or get the rows from 11 to 20.</p>
  
  <p>How do I use the row number? I can't execute this query below</p>
  
  <pre><code>SET @row_number:=0;
  SELECT @row_number:=@row_number+1 AS row_number, col1, col2, col3
  FROM table
  WHERE row_number &gt; 1 and row_number &lt; 10;
  </code></pre>
  
  <p><strong>Update:</strong> The problem is that in my where clause row_number is unknown in table
  <strong>Update 2:</strong> Thanks guys! Anyway, I found this. <a href="https://stackoverflow.com/questions/12821709/select-where-row-number-rownum">Select where row number = rownum</a></p>