View Single Post

   
  #2 (permalink)  
Old 02-28-2008, 08:02 AM
Afan Pasalic
 
Posts: n/a
Default Re: Update but insert if not exist

try REPLACE
http://dev.mysql.com/doc/refman/5.1/en/replace.html

-afan

Steffan A. Cline wrote:
> I am trying to think of a trick way to handle something. I have been
> successful in using the multiple inserts in one row by using the
> ,(xx,xx,xx),(xx,xx,xx),(xx,xx,xx) in a values block. BUT Is it possible to
> insert if not there for example
>
>
> Update xxxx
> if anyone not found then insert new with same criteria as update
> Where region_id in (2,3,4,5,6)
>
>
>
> Thanks
>
> Steffan
>
> ---------------------------------------------------------------
> T E L 6 0 2 . 7 9 3 . 0 0 1 4 | F A X 6 0 2 . 9 7 1 . 1 6 9 4
> Steffan A. Cline
> Steffan@ExecuChoice.net Phoenix, Az
> http://www.ExecuChoice.net USA
> AIM : SteffanC ICQ : 57234309
> YAHOO : Steffan_Cline MSN : steffan@hldns.com
> GOOGLE: Steffan.Cline Lasso Partner Alliance Member
> ---------------------------------------------------------------
>
>
>
>

Reply With Quote