List:General Discussion« Previous MessageNext Message »
From:Rob Wultsch Date:December 17 2007 3:55pm
Subject:Re: Update but insert if not exist
View as plain text  
On Dec 16, 2007 10:29 AM, Afan Pasalic <afan@stripped> wrote:
> try REPLACE
> http://dev.mysql.com/doc/refman/5.1/en/replace.html
>
> -afan
Replace will not do an update. All previous data will be lost.

A mysql-centric alternative solution would be to use INSERT ... ON
DUPLICATE KEY UPDATE
http://dev.mysql.com/doc/refman/5.0/en/insert-on-duplicate.html
Thread
Update but insert if not existSteffan A. Cline16 Dec
  • Re: Update but insert if not existAfan Pasalic16 Dec
    • Re: Update but insert if not existRob Wultsch17 Dec
  • Re: Update but insert if not existJ Trahair17 Dec
    • Re: Update but insert if not existJay Pipes17 Dec