| List: | General Discussion | « Previous MessageNext Message » | |
| From: | lists | Date: | April 20 2007 8:09am |
| Subject: | UPDATE and INSERT in one | ||
| View as plain text | |||
Hi, I want to update a table if it meets some conditions (already exist) and INSERT otherwise? Right now I am doing it this way: 1. SELECT the record 2. If it exist, I UPDATE it 3. If it does not exit, I INSERT a new record Could this be done in one query? I mean like conditional update/insert? /Peter
| Thread | ||
|---|---|---|
| • UPDATE and INSERT in one | lists | 20 Apr |
| • Re: UPDATE and INSERT in one | Johan Höök | 20 Apr |
| • INSERT ... ON DUPLICATE KEY UPDATE seems so close and yet so far... | Daevid Vincent | 28 Apr |
| • Re: INSERT ... ON DUPLICATE KEY UPDATE seems so close and yet sofar... | Philip Hallstrom | 28 Apr |
| • RE: INSERT ... ON DUPLICATE KEY UPDATE seems so close and yet so far... | Daevid Vincent | 30 Apr |
| • Re: UPDATE and INSERT in one | David Precious | 20 Apr |
| • Re: UPDATE and INSERT in one | wang shuming | 20 Apr |
