Xref: alice comp.databases.oracle.misc:56709 comp.databases.oracle.server:90276 comp.databases.oracle.tools:42284
Path: alice!news-feed.fnsi.net!news.maxwell.syr.edu!newsfeed.cwix.com!cyclone.southeast.rr.com!typhoon.southeast.rr.com.POSTED!not-for-mail
From: "Paul Druker" <pdruker@metaway.com>
Newsgroups: comp.databases.oracle.misc,comp.databases.oracle.server,comp.databases.oracle.tools
References: <38EA6880.BAC94B8B@att.com>
Subject: Re: How to Retrieve particular rows ?.
Lines: 41
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2919.6600
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600
Message-ID: <8pvG4.5213$d13.35747@typhoon.southeast.rr.com>
Date: Wed, 05 Apr 2000 00:03:16 GMT
X-Complaints-To: abuse@rr.com
X-Trace: typhoon.southeast.rr.com 954892996 24.28.217.226 (Tue, 04 Apr 2000 20:03:16 EDT)
NNTP-Posting-Date: Tue, 04 Apr 2000 20:03:16 EDT
Organization: RoadRunner - MGFairfax

Try:

select coll , rownum from (
select * from table1 where
    col1 <= 'some value1 ' and
    col2 = 'some value2'
order by col1 desc)
where   rownum <= 10

Regards,
Paul



"Raj" <rajarulmani@att.com> wrote in message
news:38EA6880.BAC94B8B@att.com...
> Can any one help me ?.
>
> I have problem with the following query :
>
> select coll , rownum from table1 where
>     col1 <= 'some value1 ' and
>     col2 = 'some value2'  and
>    rownum <= 10
> order by col1 desc.
>
>
> Both col1 and col2 are the primary keys of table table1, and there is
> also and index on both the columns.
>
> The query returns first 10 rows always ( irrespective of the  "  col1 <=
> 'some value1 ' " ) , which is not i expected.  I need 10 rows starting
> from 'some value1' in desc order and rownum from 1 to 10.
>
>
> Thanks,
> Raj.
>
>


