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: Andrew Hardy <nobody_at_spam.from.news.AdvanticaTech.com>
Date: Mon, 16 Jul 2001 14:47:03 +0100
Message-ID: <9iur8v$lp9$1@sun-cc204.lut.ac.uk>

"Gerrit-Jan Linker" <gjlinker_at_oraxcel.com> wrote in message news:9iq81l$sb0$1_at_neptunium.btinternet.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...

Andy Received on Mon Jul 16 2001 - 08:47:03 CDT

Original text of this message

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