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

Home -> Community -> Usenet -> c.d.o.misc -> Re: select any row?

Re: select any row?

From: Bricklen <bricklen_at_zyahoo.zcomz>
Date: Mon, 01 Nov 2004 16:11:06 GMT
Message-ID: <uethd.72912$9b.5997@edtnps84>


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

Original text of this message

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