Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: select any row?
Bricklen <bricklen_at_zyahoo.zcomz> wrote:
>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;
Also try
SELECT * FROM MYVIEW WHERE ROWNUM = 1; But much depends on the view's code.. Received on Mon Nov 01 2004 - 10:48:39 CST
![]() |
![]() |