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 -> Either it's equal or it isn't, right?

Either it's equal or it isn't, right?

From: Roy Smith <roy_at_popmail.med.nyu.edu>
Date: Tue, 05 May 1998 11:18:41 -0400
Message-ID: <roy-0505981118410001@qwerky.med.nyu.edu>


I'm really stumped by the following three queries. The first says there are N1 records in the table. The second says N2 of them have a given value. Therefore, shouldn't the number of records which don't have the value be equal to N1-N2? Either record_status is 'A' or it isn't 'A'. What other possibilities exist?

SQL> select count(*) from phone;

  COUNT(*)


     13042

SQL> select count(*) from phone where record_status = 'A';

  COUNT(*)


     12983

SQL> select count(*) from phone where record_status != 'A';

  COUNT(*)


         0

--
Roy Smith <roy_at_popmail.med.nyu.edu>
New York University School of Medicine Received on Tue May 05 1998 - 10:18:41 CDT

Original text of this message

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