Declaration
VALUES(col_name)
Description
The VALUES() function is used only in the INSERT ... ON DUPLICATE KEY UPDATE statement. In other contexts, it returns NULL.
For the INSERT ... ON DUPLICATE KEY UPDATE statement, the UPDATE clause can use the VALUES(col_name) function to reference column values from the INSERT statement.
Examples
obclient> INSERT INTO table (a,b,c) VALUES (1,2,3),(4,5,6) ON DUPLICATE KEY UPDATE c=VALUES(a)+VALUES(b);
Query OK, 2 rows affected
Records: 2 Duplicates: 0 Warnings: 0