on duplicatekey update
Update if it exists, insert if it does not exist. Operations we commonly use in business.
However, he is rarely seen in projects. What is the reason for this?
Most of them are used for business purposes.
1.select
2.insert or update
Some databases support using save instead (insert && update).
I understand that in most business scenarios, insert and update are different functions, and the corresponding SQL statement is clearly INSERT or UPDATE
When doing some complex statistical functions, the on duplicatekey update function will be used, which is the merge statement in Oracle.