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

Home -> Community -> Usenet -> c.d.o.tools -> Re: selecting first row of a view

Re: selecting first row of a view

From: Nicolas Bronke <newsgroup_at_trinity.de>
Date: Mon, 16 Jul 2001 20:56:45 +0200
Message-ID: <9ivd7v$gfu$02$1@news.t-online.com>

> > select * from your_view where rownum <=1
> >
> > Note that you need an order by clause to make it a bit more specific
 which
> > row you will fetch. Otherwise it will be roulette as to which row will
 be
> > selected...
>
> Unfortunately, the WHERE clause is used before the ORDER BY - so if rownum
> <= 1 is used there will be only one record to be ordered...
>

with 8i

select * from (select * from your_view order by <...>) where rownum <=1 regards
Nicolas Received on Mon Jul 16 2001 - 13:56:45 CDT

Original text of this message

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