INSERT ... ON DUPLICATE KEY UPDATE with WHERE?

Posted by Raven on Stack Overflow See other posts from Stack Overflow or by Raven
Published on 2010-03-18T11:37:38Z Indexed on 2010/03/18 11:41 UTC
Read the original article Hit count: 142

Filed under:
|

Hi!

I'm doing a INSERT ... ON DUPLICATE KEY UPDATE but I need the update part to be conditional, only doing the update if some extra condition has changed.

However, WHERE is not allowed on this UPDATE. Is there any workaround for this?

I can't do combinations of INSERT/UPDATE/SELECT since this needs to work over a replication.

© Stack Overflow or respective owner

Related posts about mysql

Related posts about replication