Mike Knox wrote:

Traditionally, I'd take the following approach

1) Update - assume it's there
2) If update fails (0 rows) do an insert

Thats assuming that the update case is more prevalent.  If the row is
unlikely to be there - insert and do the update if you get a duplicate key.



You have to lock the table first, or another user might insert the record between 1 and 2.


-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to