postgresql - What are the advantages and disadvantages of on duplicatekey update in MYSQL?
PHP中文网
PHP中文网 2017-06-24 09:41:38
0
1
1268

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).

PHP中文网
PHP中文网

认证高级PHP讲师

reply all (1)
Ty80

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.

    Latest Downloads
    More>
    Web Effects
    Website Source Code
    Website Materials
    Front End Template
    About us Disclaimer Sitemap
    php.cn:Public welfare online PHP training,Help PHP learners grow quickly!