> user drop primary key;". Work fine. But "alter table user add primary key
> (userName)" didn't work. It print "ERROR 1062: Duplicate entry 'a' for key
> 1". What's wrong? Help me.
This means that you have more than one record with the same value under the
userName column...
try this
SELECT us
Mysql 2.23.45 win98.
I create a table "user".
FieldTypeNullKeyDefaultExtra
idchar(10)
userNamechar(20)
I type " alter table user add primary key (id);". It work fine. "alter table
user drop primary key;". Work fine. But "alter table user add primary key
(userName)" didn