Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: selecting first row of a view
> > 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
![]() |
![]() |