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 -> Getting the first row using ORDER BY

Getting the first row using ORDER BY

From: Rishaal Jadoo <rischalj_at_dp.new.iscorltd.co.za>
Date: Mon, 11 May 1998 12:05:48 -0700
Message-ID: <35574C0C.4CA69A2@dp.new.iscorltd.co.za>


Oracle assigns the values of the pseudocolumn ROWNUM before it applies the ORDER BY clause. How would one obtain the first row of the ordered result set ?

One solution is to declare a cursor using the ORDER BY clause. Then by opening
the cursor and fetching only the first row, this row may be obtained. This seems
sloppy, however.

Any suggestions ? Received on Mon May 11 1998 - 14:05:48 CDT

Original text of this message

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