日期:2014-05-17 浏览次数:20462 次
CREATE TABLE T1(COL CHAR(1) PRIMARY KEY)
GO
INSERT T1(COL) VALUES('A'),('B'),('C'),('D'),('E')
GO
DECLARE
@page_num AS int = 2,
@row_per_page AS int = 3
SELECT
*
FROM T1
ORDER BY COL OFFSET (@page_num -1 ) * @row_per_page ROWS
FETCH NEXT @row_per_page ROWS ONLY
GO
DROP TABLE T1
GO
/**
COL
-----
D
E
**/