Home  >  Article  >  Backend Development  >  Limiting the size of the returned result set in Oracle is similar to mysql's limit (translation)-database related-PHP tutorial-_PHP tutorial

Limiting the size of the returned result set in Oracle is similar to mysql's limit (translation)-database related-PHP tutorial-_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 16:58:27749browse

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/631435.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...
Statement:
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