Hi. I found behavior of "ON DUPLICATE KEY" bit odd, and would
like to know if it's a bug or feature.
I'm trying to "insert" or "add" (not "replace") data of one
table to another table and came up with following statement:
CREATE TABLE
Hi!
On May 15, Taisuke Yamada wrote:
Hi. I found behavior of ON DUPLICATE KEY bit odd, and would
like to know if it's a bug or feature.
I'm trying to insert or add (not replace) data of one
table to another table and came up with following statement:
CREATE TABLE foo (id INT NOT NULL
Thanks for the verification.
After some experiments, I came up with an alternative using
REPLACE INTO foo (...) SELECT ... UNION ... to accomplish
the same task, so will use it for now.
INSERT INTO foo (id, value) SELECT id, value FROM bar
ON DUPLICATE KEY UPDATE value = value +