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

Home -> Community -> Usenet -> c.d.o.server -> Re: Checking if more than 0 rows exist.

Re: Checking if more than 0 rows exist.

From: <xhoster_at_gmail.com>
Date: 10 May 2005 14:30:06 GMT
Message-ID: <20050510103006.580$Xr@newsreader.com>


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 30GB
Received on Tue May 10 2005 - 09:30:06 CDT

Original text of this message

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