I've done something like this in order to use on duplicate key update
:
CREATE UNIQUE INDEX blah on mytable(my_col_to_make_an_index);
and its worked just fine. I'm just not sure what the purpose of the index name is -- in this case 'blah'. The stuff I've read says to use one but I can't fathom why. It doesn't seem to be used in queries, although I can see it if I export the schema.
So ... what purpose does the index name serve? If it helps the line in the CREATE TABLE
ends up looking like:
UNIQUE KEY `clothID` (`clothID`)
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…