Syntax\n------\n\nVALUE(col_name)\n\nDescription\n-----------\n\nIn an INSERT ... ON DUPLICATE KEY UPDATE statement, you can use the VALUES(col_name) function in the UPDATE clause to refer to column values from the INSERT portion of the statement. In other words, VALUES(col_name) in the UPDATE clause refers to the value of col_name that would be inserted, had no duplicate-key conflict occurred. This function is especially useful in multiple-row inserts.\n\nThe VALUES() function is meaningful only in INSERT ... ON DUPLICATE KEY UPDATE statements and returns NULL otherwise.\n\nThis function was renamed to VALUE(), because it's incompatible with the standard Table Value Constructors syntax.\n\nThe VALUES() function can still be used but only in INSERT ... ON DUPLICATE KEY UPDATE statements; it's a syntax error otherwise.\n\nExamples\n--------\n\nINSERT INTO t (a,b,c) VALUES (1,2,3),(4,5,6)\n    ON DUPLICATE KEY UPDATE c=VALUE(a)+VALUE(b);\n\nURL: https://mariadb.com/docs/server/reference/sql-functions/secondary-functions/miscellaneous-functions/values-value