REPLACE INTO table SET id = 42, foo = 'bar';
Pay attention: "id" must be unique in this case.
Some concerns:
http://code.openark.org/blog/mysql/replace-into-think-twice
Reference:
http://www.kavoir.com/2009/05/mysql-insert-if-doesnt-exist-otherwise-update-the-existing-row.html
Pay attention: "id" must be unique in this case.
Some concerns:
http://code.openark.org/blog/mysql/replace-into-think-twice
Reference:
http://www.kavoir.com/2009/05/mysql-insert-if-doesnt-exist-otherwise-update-the-existing-row.html
Comments
Post a Comment