Re: Regarding NULL and '' (null string) treatment in MYSQL

2005-03-30 Thread Shankar Unni
Peter Brawley wrote: Perhaps Oracle also has such a setting too. MySQL doesn't. As a matter of fact, Oracle goes the other way in that if you store '' into a VARCHAR field, it actually stores a NULL there. But it's inconsistent in that doesn't consider a NULL varchar column to be = '' (a literal

Re: Regarding NULL and '' (null string) treatment in MYSQL

2005-03-29 Thread Peter Brawley
Narasimha, In programming languages, a 'null string' is empty, but in ANSI SQL, NULL means unknown, _not_ empty, so in ANSI SQL, NULLs are never equal to anything, not even themselves: the expressions NULL=NULL, NULL<>NULL and NULL='' all evaluate to NULL. Microsoft SQL has an 'ansi_nulls' setti

Regarding NULL and '' (null string) treatment in MYSQL

2005-03-29 Thread lakshmi.narasimharao
Hi, MySQL treats NULL, '' (empty string) as different. I mean when I select from/insert into a table, its behaviour is different. Select * from table1 where name=''; is different from Select * from table1 where name=NULL; Similarly Insert into table1(name) values(