Home > Backend Development > PHP Tutorial > 如何在oracle中限制返回结果集的大小_PHP

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

WBOY
Release: 2016-06-01 12:41:03
Original
791 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

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 Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template