数据库的增加与更新合并

1. mysql 

http://dev.mysql.com/doc/refman/5.7/en/insert-on-duplicate.html

INSERT ... ON DUPLICATE KEY UPDATE 

 

2. postgrep

https://www.postgresql.org/docs/devel/static/sql-insert.html

http://stackoverflow.com/questions/1109061/insert-on-duplicate-update-in-postgresql

PostgreSQL since version 9.5 has UPSERT syntax, with ON CONFLICT clause.

 

posted @ 2016-07-27 15:03  跬步者  阅读(458)  评论(0编辑  收藏  举报