9/5/09

MySQL insert or update in one query

MySQL insert or update in one query

Posted by: Paul 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

No comments: