|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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. thanks |
|
#2
|
||||
|
||||
|
Moved to the Oracle forum.
__________________
Give a person code, and they'll hack for a day; Teach them how to code, and they'll hack forever. Analyze twice; hack once. The world's first existential ITIL question: If a change is released into production without a ticket to track it, was it actually released? About DrGroove: ITIL-Certified IT Process Engineer - Enterprise Application Architect - Freelance IT Journalist - Devshed Moderator - Funk Bassist Extraordinaire |
|
#3
|
||||
|
||||
|
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. |
|
#4
|
|||
|
|||
|
Please try:
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 Cheers, Dan Last edited by Dan Drillich : October 3rd, 2003 at 02:51 PM. |
![]() |
| Viewing: Dev Shed Forums > Databases > Oracle Development > Return certain number of rows from Oracle. |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|