IS NULL returns Empty set, but I have empty items

Hello,
I don't know what I am missing, but I have this:

mysql> SELECT url FROM product WHERE url IS NULL;
Empty set (0.05 sec)

mysql> SELECT url FROM product WHERE product_Id =3D 67;
+------+
| url |
+------+
| |
+------+
1 row in set (0.00 sec)

what goes with this, how can i ensure that this is NULL?

here is the table structure

http://pastie.org/1066140

thanks for any insight.


--
=CB=99u=CA=8Dop =C7=9Dp=C4=B1sdn p,u=C9=B9n=CA=87 p=D7=9F=C9=B9o=CA=8D =C7=
=9D=C9=A5=CA=87 =C7=9D=C7=9Ds no=CA=8E '=CA=87u=C7=9D=C9=AF=C9=90=D7=9F s=
=C7=9D=C9=AF=C4=B1=CA=87 =C7=9D=C9=A5=CA=87 pu=C9=90 '=CA=87u=C7=9D=CA=87uo=
=C9=94
=C7=9Dq s,=CA=87=C7=9D=D7=9F =CA=87=C7=9D=CA=8E
%>>> "".join( [ {'*':' [at] ','^':'.'}.get(c,None) or
chr(97+(ord(c)-83)%26) for c in ",adym,*)&uzq^zqf" ] )

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=3Dgcdmg-mysql-2 [at] m.gmane.o rg
Norman Khine [ Do, 29 Juli 2010 22:58 ] [ ID #2045280 ]

Re: IS NULL returns Empty set, but I have empty items

blank is not null... I'll bet if you did

SELECT url FROM product WHERE url = '';

you'll get a row or three. If the field was NULL, your product_id
select would look like:

+------+
| url |
+------+
|NULL |
+------+

andy

Norman Khine wrote:
> Hello,
> I don't know what I am missing, but I have this:
>
> mysql> SELECT url FROM product WHERE url IS NULL;
> Empty set (0.05 sec)
>
> mysql> SELECT url FROM product WHERE product_Id = 67;
> +------+
> | url |
> +------+
> | |
> +------+
> 1 row in set (0.00 sec)
>
> what goes with this, how can i ensure that this is NULL?
>
> here is the table structure
>
> http://pastie.org/1066140
>
> thanks for any insight.
>
>

--
Andy Wallace
iHOUSEweb, Inc.
awallace [at] ihouseweb.com
(866) 645-7700 ext 219
--
There are two ways to build software:
Make it so simple that there are obviously no bugs,
or make it so complex that there are no obvious bugs.

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql-2 [at] m.gmane.org
Andy Wallace [ Do, 29 Juli 2010 23:13 ] [ ID #2045281 ]

Re: IS NULL returns Empty set, but I have empty items

In the last episode (Jul 29), Norman Khine said:
> I don't know what I am missing, but I have this:
>
> mysql> SELECT url FROM product WHERE url IS NULL;
> Empty set (0.05 sec)
>
> mysql> SELECT url FROM product WHERE product_Id = 67;
> +------+
> | url |
> +------+
> | |
> +------+
> 1 row in set (0.00 sec)
>
> what goes with this, how can i ensure that this is NULL?

Your url may be the empty string "". If it was really NULL, you would see
"NULL" in the resultset. Try

SELECT * FROM product WHERE url=""

--
Dan Nelson
dnelson [at] allantgroup.com

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql-2 [at] m.gmane.org
Dan Nelson [ Do, 29 Juli 2010 23:29 ] [ ID #2045282 ]

Re: IS NULL returns Empty set, but I have empty items

thank you, this makes sense.

On Thu, Jul 29, 2010 at 11:29 PM, Dan Nelson <dnelson [at] allantgroup.com> wrot=
e:
> In the last episode (Jul 29), Norman Khine said:
>> I don't know what I am missing, but I have this:
>>
>> mysql> SELECT url FROM product WHERE url IS NULL;
>> Empty set (0.05 sec)
>>
>> mysql> SELECT url FROM product WHERE product_Id =3D 67;
>> +------+
>> | url =C2=A0|
>> +------+
>> | =C2=A0 =C2=A0 =C2=A0|
>> +------+
>> 1 row in set (0.00 sec)
>>
>> what goes with this, how can i ensure that this is NULL?
>
> Your url may be the empty string "". =C2=A0If it was really NULL, you wou=
ld see
> "NULL" in the resultset. =C2=A0Try
>
> SELECT * FROM product WHERE url=3D""
>
> --
> =C2=A0 =C2=A0 =C2=A0 =C2=A0Dan Nelson
> =C2=A0 =C2=A0 =C2=A0 =C2=A0dnelson [at] allantgroup.com
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe: =C2=A0 =C2=A0http://lists.mysql.com/mysql?unsub=3Dnorman [at] =
khine.net
>
>



--
=CB=99u=CA=8Dop =C7=9Dp=C4=B1sdn p,u=C9=B9n=CA=87 p=D7=9F=C9=B9o=CA=8D =C7=
=9D=C9=A5=CA=87 =C7=9D=C7=9Ds no=CA=8E '=CA=87u=C7=9D=C9=AF=C9=90=D7=9F s=
=C7=9D=C9=AF=C4=B1=CA=87 =C7=9D=C9=A5=CA=87 pu=C9=90 '=CA=87u=C7=9D=CA=87uo=
=C9=94
=C7=9Dq s,=CA=87=C7=9D=D7=9F =CA=87=C7=9D=CA=8E
%>>> "".join( [ {'*':' [at] ','^':'.'}.get(c,None) or
chr(97+(ord(c)-83)%26) for c in ",adym,*)&uzq^zqf" ] )

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=3Dgcdmg-mysql-2 [at] m.gmane.o rg
Norman Khine [ Fr, 30 Juli 2010 05:11 ] [ ID #2045304 ]
Datenbanken » gmane.comp.db.mysql.general » IS NULL returns Empty set, but I have empty items

Vorheriges Thema: Variable Expansion Using MySQL Client and .sql Files
Nächstes Thema: Can I have 30GB of Innodb Index on a 16GB 2CPU quad core server?