Mega Code Archive

 
Categories / MySQL / Table Index
 

Handling Duplicate Index Values

mysql> mysql> CREATE TABLE weatherdata     -> (     ->     station INT UNSIGNED NOT NULL,     ->     type ENUM('precip','temp','cloudiness','humidity','barometer') NOT     ->     NULL,     ->     value FLOAT,     ->     UNIQUE (station, type)     -> ); Query OK, 0 rows affected (0.01 sec) mysql> mysql> drop table weatherdata; Query OK, 0 rows affected (0.00 sec)