Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2009

    Unanswered: why NULL is not considered to be duplicate value ?

    Hello All,

    I have created the following table:
    CREATE TABLE `kuku` (
    `a` int(11) NOT NULL DEFAULT '0',
    `b` varchar(20) DEFAULT NULL,
    `c` int(11) DEFAULT NULL,
    PRIMARY KEY (`a`),
    UNIQUE KEY `aaa` (`c`)

    and tried:
    insert into kuku values (1, 'aaaa', 1);
    insert into kuku values (2, 'aaaa', 1); - alert with duplicate error message
    insert into kuku values (3, 'aaaa', null);
    insert into kuku values (4, 'aaaa', null); - no alert was found

  2. #2
    Join Date
    Nov 2004
    out on a limb
    Provided Answers: 59
    database - 0 , NULL, empty string, Default values - MySql Questions - Stack Overflow

    NULL isn't a comparable value you have to use the specific verbs to look at nulls in MySQL or for that matter virtually every other database
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    Mar 2011

    NULL is not duplicate

    Because mo two null values are equal.You can refer to MySql select with NULL value - MySQL tutorial | w3resource for learning NULL in detail.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts