Home > php教程 > php手册 > 如何在oracle中限制返回结果集的大小

如何在oracle中限制返回结果集的大小

WBOY
Release: 2016-06-13 10:13:38
Original
1292 people have browsed it

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

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