title: How can I do paging in Sybase without making temp table? (oracle rownum issue)
body: <p>In Oracle, usually query like this for paging.</p>
  
  <pre><code>SELECT * FROM (SELECT *, rownum rid  FROM TABLEA WHERE rownum &lt;= #pageend#)
  WHERE rid &gt; #pagestart#
  </code></pre>
  
  <p>However, there is no "rownum" function in Sybase DBMS.</p>
  
  <p>How can I do that query exactlly same in Sybase?</p>
  
  <p>I found some ways.</p>
  
  <ol>
  <li><p>use "rowcount"</p>
  
  <p>set rowcount 10</p>
  
  <p>select * from TABLEA</p></li>
  <li><p>use identity (make temp table)</p>
  
  <p>SELECT *, ROWNUM=IDENTITY(8) INTO #TEMP FROM TABLEA</p>
  
  <p>SELECT * FROM #TEMP WHERE ROWNUM &lt; #pageend# AND ROWNUM >= #pagestart#</p>
  
  <p>DROP TABLE #TEMP</p></li>
  </ol>
  
  <p>these are not what I want.</p>
  
  <p>rowcount is set at the session level and i don't want make temp table.</p>