![](https://static.wixstatic.com/media/11062b_fac51a38acf24ea2aa030216e01a0ea3f000.jpg/v1/fill/w_288,h_162,al_c,q_80,usm_0.66_1.00_0.01,blur_2,enc_auto/11062b_fac51a38acf24ea2aa030216e01a0ea3f000.jpg)
Syntax:
VALUES(col_name)
In 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. The VALUES()
function is meaningful only in the ON DUPLICATE KEY UPDATE clause of
INSERT statements and returns NULL otherwise. See
https://dev.mysql.com/doc/refman/8.0/en/insert-on-duplicate.html.
URL: https://dev.mysql.com/doc/refman/8.0/en/miscellaneous-functions.html
Example
mysql> INSERT INTO table (a,b,c) VALUES (1,2,3),(4,5,6)
-> ON DUPLICATE KEY UPDATE c=VALUES(a)+VALUES(b);