SQLServer:
SELECT * FROM
(
SELECT TOP(PageSize) * FROM
(
SELECT TOP (PageSize * PageIndex) *
FROM Articles
ORDER BY id DESC
)
ORDER BY id ASC
)
ORDER BY id DESC
Oracle:
select * from (
select rownum num,t1.*
from table t1 where fast=0
) where num>=intPosition and num<=intEndPosition