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: How to improve this query?

Re: How to improve this query?

From: Daniel Morgan <damorgan_at_x.washington.edu>
Date: Mon, 24 Nov 2003 06:54:42 -0800
Message-ID: <1069685709.573129@yasure>


Tom Miskiewicz wrote:
> Hi!
>
> Thanks for your reply.
>
>

>>If all you want to test for is not null and your column is indexed then

>
> you
>
>>should use
>>select count(*)
>>from table
>>where col is not null;

>
>
> I have been told, that there is no difference between count(*) and count(1).
> Is that right?
>
> Thomas

or
SELECT Count('I like the color blue')
FROM table;

BTW ... try this test:

SELECT COUNT(*)
FROM all_tables
WHERE NULL = NULL; followed by

SELECT COUNT(*)
FROM all_tables
WHERE NULL <> NULL;

That should prove the point Sybrand and Chris made.

-- 
Daniel Morgan
http://www.outreach.washington.edu/ext/certificates/oad/oad_crs.asp
http://www.outreach.washington.edu/ext/certificates/aoa/aoa_crs.asp
damorgan_at_x.washington.edu
(replace 'x' with a 'u' to reply)
Received on Mon Nov 24 2003 - 08:54:42 CST

Original text of this message

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