Home » RDBMS Server » Server Administration » Returning a set number of records
Returning a set number of records [message #374669] Sat, 23 June 2001 20:18 Go to next message
Mike Burell
Messages: 1
Registered: June 2001
Junior Member
Can anyone tell me how to return a set number of records that match a certain critera without returning all of them? For example there might be 100 records that match what I'm looking for but I only want the last 10. It seems like I learned how to do this in school but I haven't needed to do this since so I forgot.
Re: Returning a set number of records [message #374674 is a reply to message #374669] Sun, 24 June 2001 07:14 Go to previous message
venkatesh
Messages: 72
Registered: August 2000
Member
Hope, this will solve your requirement:

This will retreive the last 10 rows in emp table:
select rowid from
(select * from emp
order by rowid desc)
where rownum < 11
order by rowid asc;
Previous Topic: urgent : query not yet solved!!!!!!
Next Topic: what exactly is a nested table ?
Goto Forum:
  


Current Time: Sat Jul 06 18:21:35 CDT 2024