페 이 징 SQL

423 단어 sql.net
만능 페이지
select top          * from topic where id not in  
 (select top (     -1)×         id from topic order by id desc)   
 order by id desc  

sql 2005 페이지
with temptbl as (   
  SELECT ROW_NUMBER() OVER (ORDER BY id desc)AS Row,    
  ...   
)   
SELECT * FROM temptbl where Row between @startIndex and @endIndex  

좋은 웹페이지 즐겨찾기