sql: DELETE + INSERT vs UPDATE + INSERT

后端 未结 7 1672
花落未央
花落未央 2021-01-19 02:29

A similar question has been asked, but since it always depends, I\'m asking for my specific situation separately.

I have a web-site page that shows some data that co

相关标签:
7条回答
  • 2021-01-19 03:17

    TRUNCATE will be faster than delete, so if you need to empty a table do that instead

    You didn't specify your RDBMS vendor but some of them also have MERGE/UPSERT commands This enables you do update the table if the data exists and insert if it doesn't

    0 讨论(0)
提交回复
热议问题