Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Retrieve last N rows
hi,
You could try it this way:
select *
from ( <insert your select statement here> order by < insert the
column where you want to see the n last values> )
where rownum <= 10
hth, MS
> > Md,
> > You need to define what the last 10 rows of a table means. Tables are sets
> > of data (called tuples in math language) and an unordered set does not have
> > a last. So you need to specify what last means. For example, if you keep
> > track of when a record is inserted you might want the 10 most recently
> > inserted (or last) records. If you don't keep track of when they were
> > inserted then you can't know which ones they are.
> >
> > So you really do have to explain what last means to get the last 10 rows.
>
> Jim,
> We have table that does not contain date column. So normally some 50
> rows are inserted to this table daily. Just I want to see the last 50
> rows.
Received on Tue May 21 2002 - 14:36:04 CDT
![]() |
![]() |