Xref: alice comp.databases.oracle.server:69197
Path: alice!news-feed.fnsi.net!newsfeed.direct.ca!feed1.news.rcn.net!rcn!not-for-mail
From: vs <slootsky@erols.com>
Newsgroups: comp.databases.oracle.server
Subject: Re: Rownum function with order by statement
Date: Sun, 10 Oct 1999 07:39:57 -0400
Lines: 46
Message-ID: <38007B0D.30B45155@erols.com>
References: <37dd0b2b.0@news.cbn.net.id> <L10D3.13577$qY3.607222@newscontent-01.sprint.ca>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: EECAn6SSG5aVr+GgNIIIlncDyIi70GjcZdWeacs76zg=
X-Complaints-To: abuse@rcn.com
NNTP-Posting-Date: 10 Oct 1999 11:32:14 GMT
X-Accept-Language:  en
X-Mailer:  Mozilla 4.61 [en] (Win98; I)

You can do it in Oracle 8.1.5 or use subquery with DISTINCT in FROM
clause.


Mark Malakanov wrote:

> ROWNUM value calculated before sorting. Unfortunately so.
>
> try
>
>  select rownum, a
>  from (select distinct a from sometable)
>
> Mark
>
> Harlin Setiadarma <harlins@bigfoot.com> wrote in message
> news:37dd0b2b.0@news.cbn.net.id...
> > 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....
> >
> >
> >
> >
> >
> >

