在oracle数据库中是没有limit这个关键字的,所以需要自己写sql语句实现limit的功能.我们可以通过rownum关键字来实现.直接上例子吧
返回student结果集中前10行:
select * from student where rownum <= 10;
返回student结果集第10行到第20行:
select * from student where rownum <=20 and rownum >=10;
在Oracle数据库中,由于不支持limit关键字,我们可以利用rownum来达到类似的效果。例如,要获取student表的前10行,可以使用`select * from student where rownum <= 10`;若要获取第10行到第20行,可以使用`select * from student where rownum <= 20 and rownum >= 10`。这种方法巧妙地实现了分页查询的功能。
在oracle数据库中是没有limit这个关键字的,所以需要自己写sql语句实现limit的功能.我们可以通过rownum关键字来实现.直接上例子吧
返回student结果集中前10行:
select * from student where rownum <= 10;
返回student结果集第10行到第20行:
select * from student where rownum <=20 and rownum >=10;
4447

被折叠的 条评论
为什么被折叠?