SQLServer分页

来源:互联网 发布:武汉理工大学网络 编辑:程序博客网 时间:2024/06/09 19:22

这是MyBatis配置文件中的一个分页的SQL语句

 

<select id="selectUsersListByPage" resultMap="BaseResultMap" parameterType="java.util.Map"  >
    select * from (
     select top 100 percent *,row_number() over (order by id ) as rn
  from users_rt
  <![CDATA[
 ) s where rn <= #{end} and rn >= #{start} 
 ]]>
  </select>

原创粉丝点击