oracle的分页查询,这就是最高效?
前几天做了oracle的分页,ibatis配置如下:
<select id="getOrdersByPageNumber" parameterClass="int" resultClass="com.orders.model.Order">
<![CDATA[
select * from (select o.*,rownum r from (select * from Orders order by id) o where rownum<#pageSize#*#currentPage#) where r>=#pageSize#*(#currentPage# -1)
)
]]>
</select>
据说这是最高效的做法了,我也找不到更好的办法,因为oracle中没有limit和top