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

Home -> Community -> Mailing Lists -> Oracle-L -> sql question ???

sql question ???

From: Andrea Oracle <andreaoracle_at_yahoo.com>
Date: Thu, 06 Mar 2003 12:09:32 -0800
Message-ID: <F001.005625C7.20030306120932@fatcity.com>


Hi, I got a SQL question (9i on Red Hat), commands shown below. The first sql returns 3 rows with value 1, so trim(client_company) = '', how come the 2nd sql doesn't return anything??

SQL> select decode(trim(client_company), '', 1, ' ', 2, null, 3, 4) from cli_clients where
cli_id in (257, 396, 727);

DECODE(TRIM(CLIENT_COMPANY),'',1,'',2,NULL,3,4)


                                              1
                                              1
                                              1

3 rows selected.

SQL> select count(*) from cli_clients where trim(client_company) = '' and cli_id in (257, 396, 727);

 COUNT(*)


        0

1 row selected.



Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, more http://taxes.yahoo.com/
--

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

Author: Andrea Oracle
  INET: andreaoracle_at_yahoo.com
Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). Received on Thu Mar 06 2003 - 14:09:32 CST

Original text of this message

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