| List: | General Discussion | « Previous MessageNext Message » | |
| From: | Martijn Tonies | Date: | April 13 2007 10:09am |
| Subject: | Re: Is it possible to either update or insert in a single query? | ||
| View as plain text | |||
> REPLACE is a MySQL extension to the SQL standard. It either inserts, or > deletes and inserts. For another MySQL extension to standard SQL — that > either inserts or updates — see Section 13.2.4.3, “INSERT ... ON > DUPLICATE > KEY UPDATE Syntax”. Take note!! If you're using triggers, foreign key constraints or defaults on columns, it is better to use ON DUPLICATE cause it will update instead of deleting the row first. Martijn Tonies Database Workbench - development tool for MySQL, and more! Upscene Productions http://www.upscene.com My thoughts: http://blog.upscene.com/martijn/ Database development questions? Check the forum! http://www.databasedevelopmentforum.com
| Thread | ||
|---|---|---|
| • Is it possible to either update or insert in a single query? | Douglas Pearson | 13 Apr |
| • Re: Is it possible to either update or insert in a single query? | Carlos Proal | 13 Apr |
| • Re: Is it possible to either update or insert in a single query? | Mogens Melander | 13 Apr |
| • RE: Is it possible to either update or insert in a single query? | Douglas Pearson | 13 Apr |
| • RE: Is it possible to either update or insert in a single query? | Randall Price | 13 Apr |
| • Re: Is it possible to either update or insert in a single query? | Martijn Tonies | 13 Apr |
