Sqlserver关联查询分页

SELECT TOP
        (#{pages})  *
        FROM
        (
        SELECT ROW_NUMBER() OVER (ORDER BY
        b.intermediary_Id)
        AS RowNumber,* FROM
        (select * from user_inter_store uis inner join user_intermediary  ui on uis.intermediary_Id = ui.intermediaryId  where uis.isEnable1=1)
     as b
        ) as a
        WHERE (a.RowNumber >
        (#{pages}-1)*#{limit} )
   

你可能感兴趣的:(Sqlserver关联查询分页)