Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Help with ROW_COUNT()

Re: Help with ROW_COUNT()

From: Niall Litchfield <n-litchfield_at_audit-commission.gov.uk>
Date: Thu, 7 Dec 2000 16:40:59 -0000
Message-ID: <90oeit$sjr$1@soap.pipex.net>

you don't state version but assuming 8i how about

select pkey,value from
(select pkey,value from table1 where value is not null order by value asc) where rownum < 6;

prior to 8i the order by can't be included in the subquery.

--
Niall Litchfield
Oracle DBA
Audit Commission UK
<sw_at_weinerfamily.org> wrote in message
news:3A2BB41B.12EA754D_at_weinerfamily.org...

> I need to find the 5th row in a selection, ordered by a value column.
> Since ROWNUM takes affect after the rownum is assigned it won't work.
> So I tried using ROW_NUMBER(). However the following query doesn't
> work:
>
> SELECT pkey, value,
> ROW_NUMBER() over (ORDER BY value ASC NULLS LAST) AS valcol
> FROM table1
> WHERE valcol = 3
>
>
>
Received on Thu Dec 07 2000 - 10:40:59 CST

Original text of this message

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