This is a discussion on null is not null within the MySQL Database forums, part of the Database Forums category; Sorry if I missed a post about this before. Can someone explain this to me: mysql> select title from ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Sorry if I missed a post about this before. Can someone explain this
to me: mysql> select title from movie where id = 53259; +-------+ | title | +-------+ | NULL | +-------+ 1 row in set (0.00 sec) mysql> select title from movie where id = 53259 and title is null; Empty set (0.00 sec) mysql> select length(title) from movie where id = 53259; +---------------+ | length(title) | +---------------+ | 0 | +---------------+ 1 row in set (0.00 sec) mysql> select length(null) from movie where id = 53259; +--------------+ | length(null) | +--------------+ | NULL | +--------------+ 1 row in set (0.00 sec) As far as I can tell, this column is not NULL, and is not 'NULL'. What is it? Thanks for your help. |
|
|||
|
On 21 May, 04:18, r...@goanimate.com wrote:
> Sorry if I missed a post about this before. Can someone explain this > to me: > > mysql> select title from movie where id = 53259; > +-------+ > | title | > +-------+ > | NULL | > +-------+ > 1 row in set (0.00 sec) > > mysql> select title from movie where id = 53259 and title is null; > Empty set (0.00 sec) > > mysql> select length(title) from movie where id = 53259; > +---------------+ > | length(title) | > +---------------+ > | 0 | > +---------------+ > 1 row in set (0.00 sec) > > mysql> select length(null) from movie where id = 53259; > +--------------+ > | length(null) | > +--------------+ > | NULL | > +--------------+ > 1 row in set (0.00 sec) > > As far as I can tell, this column is not NULL, and is not 'NULL'. What > is it? > > Thanks for your help. Please export the CREATE TABLE statement and a sample of the data (as an INSERT statement) which includes this record and post it here. |
|
|||
|
ryan@goanimate.com wrote:
> select title from movie where id = 53259 and title is null; try select title from movie where id = 53259 and title = 'NULL'; probably it has been inserted as string happened to me once. -- e ziocan |
|
|||
|
On 21 May, 11:54, "motion musso: aka sathia" <sathia.mu...@libero.it>
wrote: > r...@goanimate.com wrote: > > select title from movie where id = 53259 and title is null; > > try > > select title from movie where id = 53259 and title = 'NULL'; > > probably it has been inserted as string > happened to me once. If it was a string, mysql> select length(title) from movie where id = 53259; Would have produced he answer 4 and not: +---------------+ | length(title) | +---------------+ | 0 | +---------------+ |
|
|||
|
On May 21, 5:17*pm, Captain Paralytic <paul_laut...@yahoo.com> wrote:
> Please export the CREATE TABLE statement and a sample of the data (as > an INSERT statement) which includes this record and post it here. Thanks, Captain Paralytic. From the export, it looks like an empty string: CREATE TABLE `movie` ( `id` bigint(20) unsigned NOT NULL auto_increment, `user_id` int(11) NOT NULL default '0', `domain_id` varchar(20) NOT NULL default '', `title` varchar(50) default '', ... ) ENGINE=InnoDB DEFAULT CHARSET=utf8; INSERT INTO `movie` VALUES (53248,131012,'804','','','<xml... ~rvr |
|
|||
|
ryan@goanimate.com wrote:
> On May 21, 5:17 pm, Captain Paralytic <paul_laut...@yahoo.com> wrote: >> Please export the CREATE TABLE statement and a sample of the data (as >> an INSERT statement) which includes this record and post it here. > > Thanks, Captain Paralytic. From the export, it looks like an empty > string: > > CREATE TABLE `movie` ( > `id` bigint(20) unsigned NOT NULL auto_increment, > `user_id` int(11) NOT NULL default '0', > `domain_id` varchar(20) NOT NULL default '', > `title` varchar(50) default '', > ... > ) ENGINE=InnoDB DEFAULT CHARSET=utf8; > > INSERT INTO `movie` VALUES (53248,131012,'804','','','<xml... 53248 != 53259 We're actually only interested in that record that misbehaves. From the create syntax we know it's actually a table (not a view with possible side effects for instance), and that NULLs are allowed. -- Rik Wasmus ....spamrun finished |
|
|||
|
On 22 May, 14:27, r...@goanimate.com wrote:
> On May 21, 5:17 pm, Captain Paralytic <paul_laut...@yahoo.com> wrote: > > > Please export the CREATE TABLE statement and a sample of the data (as > > an INSERT statement) which includes this record and post it here. > > Thanks, Captain Paralytic. From the export, it looks like an empty > string: > > CREATE TABLE `movie` ( > `id` bigint(20) unsigned NOT NULL auto_increment, > `user_id` int(11) NOT NULL default '0', > `domain_id` varchar(20) NOT NULL default '', > `title` varchar(50) default '', > ... > ) ENGINE=InnoDB DEFAULT CHARSET=utf8; > > INSERT INTO `movie` VALUES (53248,131012,'804','','','<xml... > > ~rvr My instructions were: Please export the CREATE TABLE statement and a sample of the data (as an INSERT statement) which includes this record and post it here. Note the "which includes this record" bit!!! |
![]() |
| Thread Tools | |
| Display Modes | |
|
|