Home > Backend Development > PHP Tutorial > How to limit the size of the returned result set in oracle_PHP tutorial

How to limit the size of the returned result set in oracle_PHP tutorial

WBOY
Release: 2016-07-13 17:12:16
Original
718 people have browsed it

Oracle does not support limit similar to MySQL. But you can still use rownum to limit the number of rows in the returned result set.
If you only want to return the first ten rows of records, you can write like this:
SELECT * FROM table WHERE ROWNUM<10;
But the following statement is incorrect:
SELECT * FROM table WHERE ROWNUM>90 AND ROWNUM<100;
This is because Oracle believes that this condition is not true, so it does not return.
You should write like this:
SELECT * FROM table WHERE ROWNUM<101;
minus
SELECT * FROM table WHERE ROWNUM<91;

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/629510.htmlTechArticleOracle does not support limit similar to MySQL. But you can still use rownum to limit the number of rows in the returned result set. . If you only want to return the first ten rows of records, you can write like this: SELECT * F...
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