Home > php教程 > php手册 > 在oracle中限制返回结果集的大小,类似于mysql的limit(转译)

在oracle中限制返回结果集的大小,类似于mysql的limit(转译)

WBOY
Release: 2016-06-21 09:09:23
Original
1243 people have browsed it

mysql|oracle

Oracle不支持类似于 MySQL 中的 limit. 但你还是可以rownum来限制返回的结果集的行数.

如果你只希望返回前十行纪录,你可以这样写:

SELECT * FROM table WHERE ROWNUM
但是下面的语句是不对的:

SELECT * FROM table WHERE ROWNUM>90 AND ROWNUM
这是因为 Oracle 认为这个条件不成立,所以没有返回。
你应该这样写:

SELECT * FROM table WHERE ROWNUMminus
SELECT * FROM table WHERE ROWNUM 



Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template