for example:
has a table in which two columns, title and provenance, are set with unique properties
demand:
,,
attempt operation:
when inserting using the following sql statement, it is found that only one piece of data can be inserted. Limited by the above two unique columns, only one piece of data has been inserted, that is, two unique columns are now in effect at the same time instead of the combination
insert into xxx .... ON DUPLICATE KEY UPDATE xxx=xxx;
other ways:
query the data before inserting select, and judge whether the data exists according to the result
does not exist, then insert the data. If it exists, skip this operation
current requirements:
A sql statement to solve the problem, similar to the above sql
Thank you for asking for the first time.