The LIMIT clause in Oracle is used to limit the number of rows retrieved. The syntax is: SELECT * FROM table_name LIMIT start_row, row_count. start_row specifies the number of rows to skip (starting from 0), and row_count specifies the number of rows to retrieve.
LIMIT Clause in Oracle
What is LIMIT clause?
The LIMIT clause is used to limit the number of rows retrieved from an Oracle database table.
Syntax:
<code>SELECT * FROM table_name LIMIT start_row, row_count</code>
Where:
start_row
Specifies the number of rows to skip, starting from 0 . row_count
Specifies the number of rows to retrieve. Usage:
The LIMIT clause is placed at the end of the SELECT statement. It can be used to page results or retrieve a specific number of rows.
Example:
Retrieve the first 10 rows:
<code>SELECT * FROM customers LIMIT 10;</code>
Retrieve the 5 rows starting from row 10 :
<code>SELECT * FROM customers LIMIT 9, 5;</code>
Note:
start_row
is not specified, the default value is 0, starting from the first row start. row_count
is negative, no rows will be retrieved. The above is the detailed content of How to use limit in oracle. For more information, please follow other related articles on the PHP Chinese website!