So if there is a UNIQUE(a,b) constraint on the table in the example, then the INSERT is equivalent to this UPDATE statement: UPDATE table SET c=c 1 WHERE a=1 AND b=2;(and not "a=1 OR b=2") Regarding the trick for making LAST_INSERT_ID() well defined for updates: INSERT INTO table (a,b,c) VALUES (1,2,3) ON DUPLICATE KEY UPDATE id=LAST_INSERT_ID(id), c=3; This does not work if nothing changes, presumably because My SQL doesn't run the dummy update at all then. if there is an existing record with 3 in column c then LAST_INSERT_ID() still won't return the AUTO_INCREMENT id afterwards.I'm not sure whether this should be regarded as a bug or not, but it does make the construct less useful.When using ON DUPLICATE KEY in combination with a BEFORE INSERT trigger note that if you update a NEW.col_name value in the BEFORE INSERT trigger this will effect the value och values(col_name) in then ON DUPLi CATE KEY UPDATE statement!Updates to other NEW.col_name in the BEFORE INSERT trigger that is not used in the values(col_name) statement are discarded. 2/b324a/1 If you have an autoincrement pk, and a unique key on say an email address, and the 'on duplicate update' triggers based on the email address, note that the last_insert_id' will NOT be the autoincrement value of the updated row.
The trick is to use user-defined variable to store computed data, so that it is not need to be computed again. Don't forget that UPDATE in My SQL is not standard-conformant.
These instructions reside in a file on the server that administers the site. Read below on how to lower your TTL value for a smooth transition.
This article explains how to edit your zone file hosted on the (mt) Media Temple nameservers, NS1. NOTE: Any changes to your DNS zone file will need to propagate across the Internet.
To perform a DNS lookup to ensure you've entered the record correctly, you can use the dig command to look it up: Before you make any other type of DNS change, it's a good idea to consider whether you will need to lower your TTL.
For more information and detailed instructions, please see: How can I lower or raise the TTL for my domain?