Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Hod do I select the last 100 records of a Table.

Re: Hod do I select the last 100 records of a Table.

From: <shiling_at_math.wayne.edu>
Date: Tue, 22 Jun 1999 13:31:34 GMT
Message-ID: <7ko37n$8rq$1@nnrp1.deja.com>


Here is an example of selecting last three.

SQL> select * from t;

TDATE


09-JAN-99
09-JAN-98
09-JAN-97
09-JAN-96
09-JAN-95
09-JAN-94

6 rows selected.

SQL> select * from t
  2 minus
  3 select * from t where rownum <= (select count(*)-3 from t);

TDATE


09-JAN-94
09-JAN-95
09-JAN-96

SQL> Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't. Received on Tue Jun 22 1999 - 08:31:34 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US