3 回答
TA贡献1856条经验 获得超11个赞
方法1:
适用于 SQL Server 2000/2005
SELECT TOP 页大小 *
FROM table1
WHERE id NOT IN
(
SELECT TOP 页大小*(页数-1) id FROM table1 ORDER BY id
)
ORDER BY id
方法2:
适用于 SQL Server 2000/2005
SELECT TOP 页大小 *
FROM table1
WHERE id >
(
SELECT ISNULL(MAX(id),0)
FROM
(
SELECT TOP 页大小*(页数-1) id FROM table1 ORDER BY id
) A
)
ORDER BY id
方法3:
适用于 SQL Server 2005
SELECT TOP 页大小 *
FROM
(
SELECT ROW_NUMBER() OVER (ORDER BY id) AS RowNumber,* FROM table1
) A
WHERE RowNumber > 页大小*(页数-1)
TA贡献1772条经验 获得超8个赞
oracle :
select * from (select *,rownum from table order by culm1) A where A.rownum>10 and A.rownum<20
sql server :
select top 10 * from (
select top 20 * from table1 order by culm1
) order by culm1 desc
- 3 回答
- 0 关注
- 917 浏览
添加回答
举报