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 -> Help: Numbering rows returned by a SQL query

Help: Numbering rows returned by a SQL query

From: Edward Tate <e.j.tate_at_NOSPAM.newport.ac.uk>
Date: Mon, 26 Oct 1998 21:39:44 +0000
Message-ID: <3634EC20.1F799C1E@NOSPAM.newport.ac.uk>


Does anyone know how I can number the rows returned by a SQL statement, for example

   SELECT SURNAME
   FROM EMP
   ORDER BY SURNAME
   /

to produce

   1 ADAMS
   2 BROWN
   3 THOMAS
   4 YOUNG I have tried using rownum, but of course the numbers are jumbled by the alpha sort on the surname!

Any suggestions would be most welcome.

Thanks in advance.

Ted Tate
University of Wales College, Newport

e.j.tate_at_NOSPAM.newport.ac.uk

>>> Remove the NOSPAM. in the address when replying. <<<
Received on Mon Oct 26 1998 - 15:39:44 CST

Original text of this message

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