MySQL insert or update in one query
Posted on: October 29, 2007
Another MySQL timesaver:
INSERT INTO Sales(TransId, Status, Amount)
VALUES(123, 'Pending', 20)
ON DUPLICATE KEY UPDATE Status = 'Paid'
Via Particletree
————
Need to improve your MySQL skills? I recommend:
High Performance MySQL: Optimization, Backups, Replication, and More

1 | Leonardo França » Usando Insert ou Update em uma query no MySQL
March 25, 2009 at 3:05 pm
[...] http://thingsilearn.wordpress.com/2007/10/29/mysql-insert-or-update-in-one-query/ http://particletree.com/notebook/to-insert-or-to-update/ [...]