程序员人生 网站导航

Sql server 2005实现RowNUMBER分页

栏目:Sqlserver时间:2014-05-04 08:05:21
SQL语句:
Select * From (Select (ROW_NUMBER() OVER(ORDER BY ID asc)) AS rownum,* From [TABLENAME]) t
Where rownum BETWEEN 1 AND 20 

说明:这个是显示前20条记录,
rownum:是显示行数的列;
ID:表TABLENAME的排序字段
------分隔线----------------------------
------分隔线----------------------------

最新技术推荐