MySQL behavior of ON DUPLICATE KEY UPDATE for multiple UNIQUE fields
问题 From MySQL 4.1.0 onwards, it is possible to add ON DUPLICATE KEY UPDATE statement to specify behavior when values inserted (with INSERT or SET or VALUES ) are already in destination table w.r.t. PRIMARY KEY or some UNIQUE field. If value for PRIMARY KEY or some UNIQUE field are already in table, INSERT is replaced by an UPDATE . How does ON DUPLICATE KEY UPDATE behave in case there are multiple UNIQUE fields in my table ? Can I have one update only, if either UNIQUE field is matched ? Can I