javascript - How to avoid duplication with data in the library when inserting data in mysql?
给我你的怀抱
给我你的怀抱 2017-05-24 11:33:09
0
3
726

How to avoid duplication of already inserted data when inserting data into a mysql database table? What should I do? Please advise, thank you!

给我你的怀抱
给我你的怀抱

reply all(3)
漂亮男人

Create unique index

Single key index:
create unique index UNIQUE_PERSON_NICK_NAME_INDEX ON Person (NickName) create unique index UNIQUE_PERSON_NICK_NAME_INDEX ON Person (NickName)
双键索引:
create unique index UNIQUE_PERSON_FULL_NAME_INDEX ON Person (LastName, FirstName)Double key index:

create unique index UNIQUE_PERSON_FULL_NAME_INDEX ON Person (LastName, FirstName)


MYSQL complete index creation syntax:

MYSQL5.7 CREATE INDEX Syntax🎜
黄舟

When you say repetition, do you mean one field is repeated or all fields are repeated?

迷茫

Some usage summary of insert ignore into, replace into, etc. in MySQL

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template