Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Checking if more than 0 rows exist.
phil_herring_at_yahoo.com.au wrote:
>
> ROWNUM = 1 won't actually change the execution time:
Well, not if you use it incorrectly, no.
>
> SQL> select count(*) from foo.bar
> 2 where office = 45
> 3 and statement = 199901
> 4 and rownum = 1;
>
> COUNT(*)
> ----------
> 1
>
> Elapsed: 00:00:06.06
How about:
select count(*) from (select * from foo.bar where
office = 45
and statement = 199901
and rownum = 1);
Xho
-- -------------------- http://NewsReader.Com/ -------------------- Usenet Newsgroup Service $9.95/Month 30GBReceived on Tue May 10 2005 - 09:30:06 CDT
![]() |
![]() |