title: LIMIT 10..20 in SQL Server
body: <p>I'm trying to do something like :</p>
  
  <pre><code>SELECT * FROM table LIMIT 10,20
  </code></pre>
  
  <p>or</p>
  
  <pre><code>SELECT * FROM table LIMIT 10 OFFSET 10
  </code></pre>
  
  <p>but using SQL Server</p>
  
  <p>The only <a href="http://blogs.msdn.com/sqlserver/archive/2006/10/25/limit-in-sql-server.aspx" rel="noreferrer">solution I found</a> looks like overkill:</p>
  
  <pre><code>SELECT * FROM ( 
    SELECT *, ROW_NUMBER() OVER (ORDER BY name) as row FROM sys.databases 
   ) a WHERE row &gt; 5 and row &lt;= 10
  </code></pre>
  
  <p>I also <a href="http://vorg.ca/626-the-MS-SQL-equivalent-to-MySQLs-limit-command" rel="noreferrer">found</a>:</p>
  
  <pre><code>SELECT TOP 10 * FROM stuff; 
  </code></pre>
  
  <p>... but it's not what I want to do since I can't specify the starting limit.</p>
  
  <p>Is there another way for me to do that ? </p>
  
  <p>Also, just curious, is there a reason why doesn't SQL Server support the <code>LIMIT</code> function or something similar? I don't want to be mean, but that really sounds like something a DBMS needs ... If it does, then I'm sorry for being so ignorant! I've been working with MySQL and SQL+ for the past 5 years so...</p>