select * from (
select t1.*, t2.* ,ROW_NUMBER() OVER (order by t1.siteID ) AS RowNo
from t1
inner join t2 on (t1.f1 = t2.f1)
)
as A where A.RowNo between @beginRowNo and @endRowNum
select t1.*, t2.* ,ROW_NUMBER() OVER (order by t1.siteID ) AS RowNo
from t1
inner join t2 on (t1.f1 = t2.f1)
)
as A where A.RowNo between @beginRowNo and @endRowNum