select * from
(
select *, ROW_NUMBER() OVER(ORDER BY id DESC) AS rownum from dbo.fc_newhouse
)as t
where t.rownum>@startId and t.rownum<@endId
select * from
(
select *, ROW_NUMBER() OVER(ORDER BY id DESC) AS rownum from dbo.fc_newhouse
)as t
where t.rownum>@startId and t.rownum<@endId