October 3rd, 2003, 01:15 PM
Return certain number of rows from Oracle.
Is there a way to start at an only return a certain number of rows from an Oracle table using PHP, I've accomplished this in another scripting language(Net.Data) where you can set the starting row and the total number of rows to return.
for example: starting row = 1 total rows = 11 returns the first eleven rows for an sql statement, then starting row = 12 total rows = 11 would return the next eleven and so on.
October 3rd, 2003, 02:06 PM
Moved to the Oracle forum.
October 3rd, 2003, 03:13 PM
You can either:
- Use a stored procedure
- Use rownum to limit the number of records returned
In the second case you should run a select count before the real query to retrieve the total number of rows returned.
October 3rd, 2003, 03:38 PM
select table_name, n from (
select table_name, rownum n from (
select table_name from all_tables
order by table_name)
) where n >= 2 and n <= 4
Last edited by Dan Drillich; October 3rd, 2003 at 03:51 PM.