Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: select any row?
Dirk Schwarzmann wrote:
> Hi,
>
> hopefully this is not a FAQ:
> (How) can I select just one row from a view? I am not interested in
> the content, I merely need it (in my Java app) to get the structure of
> the table / view. I know I can use
>
> SELECT * FROM MYVIEW WHERE ROWNUM < 2;
>
> but this quite slow. It seems like Oracle collects all rows in the
> first run and than truncates all unnecessary rows before it returns
> the rows to the user.
> I guess the fastest way of receiving any row would be to tell Oracle
> "just take the first row you find and return it, damn!"
> How can I do so?
>
> Thanks in advance,
> Dirk
>
>
try
select /*+ first_rows */ * from myview where rownum<2;
Received on Mon Nov 01 2004 - 10:11:06 CST
![]() |
![]() |