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

Home -> Community -> Usenet -> c.d.o.misc -> Easy SQL problem

Easy SQL problem

From: Ben <ben_pencs_at_hotmail.com>
Date: 8 Aug 2002 16:47:45 -0700
Message-ID: <6d04baec.0208081547.5aa3527e@posting.google.com>


Any one know if this is a new 9i feature or not?

I have the following table.

SQL> desc table1

 Name                                                  Null?    Type
 ----------------------------------------------------- --------
-----------
 ID                                                            
VARCHAR2(5)
 NAME                                                          
VARCHAR2(5) SQL> insert into table1 values ('242','');

1 row created.

SQL> select * from table1;

ID NAME
----- ------------------------------

1     A
2     A
3     C
4     D

5. E
aaa C
242

7 rows selected.

SQL> select * from table1 where name is null;

ID NAME
----- ------------------------------

242

SQL> select * from table1 where name is not null;

ID NAME
----- ------------------------------

1     A
2     A
3     C
4     D

5. E
aaa C

6 rows selected.

SQL> select * from table1 where name <> '';

no rows selected

SQL> select * from table1 where name = '';

no rows selected

My question is why do I get no rows selected for "select * from table1 where name <> '';" and "select * from table1 where name = '';"?

Any idea?

Thanks!!
Ben Received on Thu Aug 08 2002 - 18:47:45 CDT

Original text of this message

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