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

Home -> Community -> Mailing Lists -> Oracle-L -> Re: where clause

Re: where clause

From: David Boyd <davidb158_at_hotmail.com>
Date: Fri, 06 Feb 2004 15:11:32 -0500
Message-ID: <BAY2-F128u6qHWvG6Qu00046d1f@hotmail.com>


That works. Thanks very much, Shamita. I really appreciate your help.

>From: Shamita Singh <shamita_s_at_yahoo.com>
>Reply-To: oracle-l_at_freelists.org
>To: oracle-l_at_freelists.org
>Subject: Re: where clause
>Date: Fri, 6 Feb 2004 12:01:19 -0800 (PST)
>
>You need to use NVL. For example, NVL(status_flag,'X') != 'A' where 'X' is
>any value other than 'A'. It does not recognise the null values.
>
>Regards,
>Shamita
>David Boyd <davidb158_at_hotmail.com> wrote:
>Hi List,
>
>I found following results that I don't understand.
>
>SQL> desc test
>Name Null? Type
>----------------------------------------- -------- -----------------
>STATUS_FLAG CHAR(1)
>
>SQL> SELECT COUNT(*) FROM test;
>
>COUNT(*)
>----------
>1681
>
>SQL> SELECT COUNT(*) FROM test WHERE status_flag IS NULL;
>
>COUNT(*)
>----------
>1638
>
>SQL> SELECT COUNT(*) FROM test WHERE status_flag ='A';
>
>COUNT(*)
>----------
>5
>
>SQL> SELECT COUNT(*) FROM test WHERE status_flag ='S';
>
>COUNT(*)
>----------
>38
>
>SQL> SELECT COUNT(*) FROM test WHERE status_flag !='A';
>
>COUNT(*)
>----------
>38
>
>I thought the last query should return 1676 (status_flag ='S' + status_flag
>is null) instead of 38 (status_flag ='S' only). Any ideas???
>
>_________________________________________________________________
>Let the advanced features & services of MSN Internet Software maximize your
>online time. http://click.atdmt.com/AVE/go/onm00200363ave/direct/01/
>
>----------------------------------------------------------------
>Please see the official ORACLE-L FAQ: http://www.orafaq.com
>----------------------------------------------------------------
>To unsubscribe send email to: oracle-l-request_at_freelists.org
>put 'unsubscribe' in the subject line.
>--
>Archives are at http://www.freelists.org/archives/oracle-l/
>FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html
>-----------------------------------------------------------------
>
>Shamita
>
>
>---------------------------------
>Do you Yahoo!?
>Yahoo! Finance: Get your refund fast by filing online
>
>----------------------------------------------------------------
>Please see the official ORACLE-L FAQ: http://www.orafaq.com
>----------------------------------------------------------------
>To unsubscribe send email to: oracle-l-request_at_freelists.org
>put 'unsubscribe' in the subject line.
>--
>Archives are at http://www.freelists.org/archives/oracle-l/
>FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html
>-----------------------------------------------------------------



Get some great ideas here for your sweetheart on Valentine's Day - and beyond. http://special.msn.com/network/celebrateromance.armx

Please see the official ORACLE-L FAQ: http://www.orafaq.com

To unsubscribe send email to: oracle-l-request_at_freelists.org put 'unsubscribe' in the subject line.
--
Archives are at http://www.freelists.org/archives/oracle-l/
FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html
-----------------------------------------------------------------
Received on Fri Feb 06 2004 - 14:11:32 CST

Original text of this message

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