CREATE TABLE `test` (
`id` MEDIUMINT(8) UNSIGNED NOT NULL AUTO_INCREMENT,
`value` VARCHAR(50) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE INDEX `value` (`value`)
)
ENGINE=InnoDB
insert into test(value) values('z');
insert into test(value) values('a');
select * from test
id | value |
2 | a |
1 | z |