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 -> Re: Rownum function with order by statement

Re: Rownum function with order by statement

From: Jay Weiland <jay_at_pixar.com>
Date: Tue, 14 Sep 1999 09:57:37 -0700
Message-ID: <37DE7E81.3D21AD21@pixar.com>


Prior releases to 8.1 do support the 'group by' syntax. Mind you this is a hack that works due to the manner in which the group by function operates, and will also only work in ascending order. Try:

select rownum, a_order
  from ( select a a_order

            from sometable
        group by a);

Jay!!!

Harlin Setiadarma wrote:

> Hi,
> can anybody help me ?
>
> I want to :
> select rownum, a
> from sometable
> order by a
>
> where a :
>
> 5
> 3
> 6
> 2
>
> The result I expected is :
> 1 2
> 2 3
> 3 5
> 4 6
>
> Thanks in advance....
Received on Tue Sep 14 1999 - 11:57:37 CDT

Original text of this message

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