How would I insert multiple rows or values and avoid duplicates in the following schema.
table schema is
id,subject1,subject2,subject3
id is auto incremented.
A duplicate would be where all subject1,subject2,subject3 already exist in a record in the exact same order.
INSERT INTO "table_name" ("subject1","subject2","subject3")
VALUES ("cats", "dogs", "hamsters")
VALUES ("squirrels", "badgers", "minxes")
VALUES ("moose", "deer", "ocelots")
In the table let's say I already have a record for
id,subject1,subject2,subject3
1,"cats", "dogs", "hamsters"
so I want it to just insert
VALUES ("squirrels", "badgers", "minxes")
VALUES ("moose", "deer", "ocelots")
I've seen answers about avoiding duplicates for single items, but not for 3.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…