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

Home -> Community -> Mailing Lists -> Oracle-L -> RE: Finding out last 10 records

RE: Finding out last 10 records

From: Amjad Saiyed <amjad_at_medicomsoft.com>
Date: Wed, 14 Aug 2002 02:23:20 -0800
Message-ID: <F001.004B403A.20020814022320@fatcity.com>


Hi Santosh,

i assume that u will b ordering the query based on some criteria .... so say u have table A with column x....

for finding the 1st 10 records we will use the following query:

select x from A
where rownum < 11
order by 1
/

for finding the last 10 records we will use the following query:

select x from A
where rownum < 11
order by 1 desc
/

the only difference is in the ordering...

i hope this helps u out..

rgds,
Ams..
www.medicomsoft.com

  -----Original Message-----
  From: root_at_fatcity.com [mailto:root_at_fatcity.com]On Behalf Of Santosh Varma   Sent: Wednesday, August 14, 2002 1:49 PM   To: Multiple recipients of list ORACLE-L   Subject: Finding out last 10 records

  Hello all

      Could any one of you guide me on how to select last 10 records from a table. and also finding out first 10 records..

  Thanks and regards,

  Santosh

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Amjad Saiyed
  INET: amjad_at_medicomsoft.com

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
Received on Wed Aug 14 2002 - 05:23:20 CDT

Original text of this message

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