| List: | General Discussion | « Previous MessageNext Message » | |
| From: | Alec.Cawley | Date: | September 15 2003 3:12pm |
| Subject: | Re: Does NULL == ""? | ||
| View as plain text | |||
No, NULL is not the same as the empty string. NULL, for any class of field,
means that no data has ever been written there. Tests involving NULL other
than IS NULL and IS NOT NULL will return NULL. Thus "" < "a" returns 1
(true) whereas NULL < "a" returns NULL, which will always be regarded as a
"miss" in any select.
|---------+---------------------------->
| | "Randy Chrismon" |
| | <rchrismon@patmed|
| | ia.net> |
| | |
| | 15/09/2003 16:00 |
| | |
|---------+---------------------------->
>------------------------------------------------------------------------------------------------------------------------------|
|
|
| To: mysql@stripped
|
| cc:
|
| Subject: Does NULL == ""?
|
>------------------------------------------------------------------------------------------------------------------------------|
The MySQL documentation confuses me a bit. If I create a table with
property NOT NULL and default "", does that mean that a record with a
column so defined will have a zero-length string in that column if I
don't provide a value? I guess what I'm asking is whether there's a
difference between a field with NULL in it and a field with a
zero-length ("") string in it.
Thanks.
Randy
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:
http://lists.mysql.com/mysql?unsub=1
| Thread | ||
|---|---|---|
| • Does NULL == ""? | Randy Chrismon | 15 Sep |
| • Re: Does NULL == ""? | Bruce Feist | 15 Sep |
| • RE: Does NULL == ""? | Mark Richards | 15 Sep |
| • Re: Does NULL == ""? | Brent Baisley | 15 Sep |
| • Re: Does NULL == ""? | Keith C. Ivey | 15 Sep |
| • Re: Does NULL == ""? | Paul DuBois | 15 Sep |
| • Re: Does NULL == ""? | Alec.Cawley | 15 Sep |
| • RE: Does NULL == ""? | Mark Richards | 15 Sep |
| • Re: Does Null == ""? | Randy Chrismon | 15 Sep |
| • RE: Does Null == ""? | Mark Richards | 15 Sep |
| • Re: Does Null == ""? | Bob Hall | 16 Sep |
| • Re: Does Null == ""? | Bruce Feist | 16 Sep |
| • Re: Does Null == ""? | Dan Nelson | 16 Sep |
| • Re: Does Null == ""? | Bruce Feist | 16 Sep |
| • Re: Does Null == ""? | Bob Hall | 16 Sep |
| • Re: Does Null == ""? | Bob Hall | 16 Sep |
| • RE: Does Null == ""? | Jon Frisby | 16 Sep |
| • Re: Does Null == ""? | Bruce Feist | 16 Sep |
| • RE: Does Null == ""? | Jon Frisby | 16 Sep |
| • Re: Does Null == ""? | Bruce Feist | 16 Sep |
| • RE: Does Null == ""? | Jon Frisby | 16 Sep |
| • Re: Does Null == ""? | Bob Hall | 17 Sep |
| • Re: Does Null == ""? | Bob Hall | 16 Sep |
| • Re: Does Null == ""? | Bob Hall | 16 Sep |
| • Re: Does Null == ""? | Bob Hall | 17 Sep |
| • Re: Does Null == ""? | Bruce Feist | 18 Sep |
| • Re: Does Null == ""? | Bob Hall | 18 Sep |
| • Re: Does Null == ""? | Haydies | 18 Sep |
| • Re: Does Null == ""? | Bob Hall | 18 Sep |
