<!-- 取得所有租赁合同列表 有分页 -->
<select id="selectListByAllWithPage" resultMap="RentResultMap">
select * from (select *,ROWNUM rn from RENT where ROWNUM <=#{end}) where rn >=#{start}
</select>
就这样简单的sql分页查询语句,却一直报错
ORA-00923: 未找到要求的 FROM 关键字
一开始还以为跟FROM有关,但改了半天也没发现哪里有问题,试试看的心情这样修改了代码
<!-- 取得所有租赁合同列表 有分页 -->
<select id="selectListByAllWithPage" resultMap="RentResultMap">
select * from (select b.*,ROWNUM rn from RENT b where ROWNUM <=#{end}) where rn >=#{start}
</select>
发现问题解决了,正常运行
虽然还不知道具体原理,但以后如果输出字段有*和其他字段,要记得在输出的*前加上表名。