At 3:35 +0800 6/14/02, Andy Sy wrote:
>----- Original Message -----
>From: "Paul DuBois" <[EMAIL PROTECTED]>
>To: "Andy Sy" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
>Sent: Friday, June 14, 2002 2:45 AM
>Subject: Re: Why does Key==Mul in DESCRIBE TABLE for unique key?
>
>
>>  At 2:03 +0800 6/14/02, Andy Sy wrote:
>>  >mysql> CREATE TABLE X (FLD1 INT UNIQUE);
>>  >Query OK, 0 rows affected (0.05 sec)
>>  >
>>  >mysql> DESCRIBE X;
>>  >+-------+---------+------+-----+---------+-------+
>>  >| Field | Type    | Null | Key | Default | Extra |
>>  >+-------+---------+------+-----+---------+-------+
>>  >| FLD1  | int(11) | YES  | MUL | NULL    |       |
>>  >+-------+---------+------+-----+---------+-------+
>>  >
>>  >Doesn't MUL mean a key can exist multiple times
>>  >in the index?
>>
>>  Right. It means it's part of a non-unique index.
>
>But I declared the field as UNIQUE (see the CREATE
>TABLE statement).

UNIQUE indexes can contain multiple NULL values.

Declare the column as FLD1 INT NOT NULL UNIQUE
and you'll see a difference.


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to