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 -> Row number base on sorting order?

Row number base on sorting order?

From: <kimboon_at_my-dejanews.com>
Date: Wed, 05 May 1999 03:56:24 GMT
Message-ID: <7gofh6$iva$1@nnrp1.dejanews.com>


Hi,

        I have these data :
col_a



 D
 B
 A
 E
 C
 F
  1. I want to assign a row number in the order of col_a, result looks like this :

row_no col_a
------ -----

 1       A
 2       B
 3       C
 4       D
 5       E
 6       F

        2. I want to retrieve the first 4 rows in the order of col_a, result
looks like this :

col_a



 A
 B
 C
 D

  ROWNUM doesn't help in these cases, as it was assigned before ordering.

        Any help ??
        TIA !!!

Jinwen

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own Received on Tue May 04 1999 - 22:56:24 CDT

Original text of this message

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