开发者

Which SQL is Better? on MySQL 5.1

In MySQL INSERT

  1. REPLACE INTO
  2. INSERT INTO .. ON DUPL开发者_JAVA技巧ICATE KEY UPDATE

Which SQL is Better? Could you give me a advice?


Depends what you're doing with them. REPLACE INTO is technically faster since it doesn't have to do a read before updating (but that is mostly irrelevant), but I've felt that INSERT INTO ... ON DUPLICATE KEY UPDATE is generally more clear as to what you want to do.

Here is a short discussion in a blog.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜