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 -> SQL Problem - Retrieving first n sorted rows

SQL Problem - Retrieving first n sorted rows

From: Ariel Kirson <arielk_at_dns.exlibris.co.il>
Date: Thu, 22 Oct 1998 16:33:13 +0200
Message-ID: <362F4229.F8CC11A2@dns.exlibris.co.il>


Hello all,

I have seen a few references to queries which retrieve the first N rows of a table in various FAQs on the web. I am however, trying to retrieve the N rows of a table with the smallest values of a certain column.

e.g.

Table : Full_Rec
Columns : Rec_Key (key)

                   Doc_Number
                   Doc_Title

I would like the titles of the 50 lowest Doc_Numbers (the table is sorted by Rec_Key, and not by Doc_Number of course).

I am using Oracle 7.3.3. and PL/SQL 2.3.3.

Thank you in advance for any solutions,

Best regards,

Ariel Kirson
Ex Libris. Received on Thu Oct 22 1998 - 09:33:13 CDT

Original text of this message

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