REPLACE is a special INSERT/UPDATE combination where you dont specify a filter, it uses the primary key. If no existing record exists, it INSERTs a new one, otherwise it UPDATEs an existing one.

What you are looking for is the UPDATE command.
----- Original Message ----- From: "bruce" <[EMAIL PROTECTED]>
To: <mysql@lists.mysql.com>
Sent: Friday, August 11, 2006 12:28 AM
Subject: insert/replace question...


hi.

i have the following that works... in that it does a replace on the row.

replace into appTBL
            (appName, universityID)
             values(%s,%s)...

i'm trying to figure out how to do the replace on the row if a given column
is not equal to a certain value..

i've tried...
replace into appTBL
            (appName, universityID)
             values(%s,%s)
             where foo != 66

and various combinations but i'm getting an error regarding the 'where'
clause...

i've searched the mysql site, as well as google, and can't quite figure out
how to accomplish this.. is there another, more efficient/better way to
resolve this...

any thoughts/comments...


thanks



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



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

Reply via email to