0

I have a problem understanding the part 'ON DUPLICATE KEY UPDATE column_name = VALUES (column_name)' in my query.

This is my query:

INSERT INTO user_mst(first_name,middle_name,last_name,corp_id,login_name,passwd,emp_num,designation,band_name,corp_mail_id,pers_mail_id,cont_phone,cont_mobile,passport_num,place_of_issue,passport_exp,user_status,user_class,hwc , gender,traveller_email_id,legal_entity) 
VALUES(?,?,?,?,?,AES_ENCRYPT(?,?),?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) 
ON DUPLICATE KEY UPDATE traveller_email_id = VALUES(traveller_email_id)

I don't understand the part starting from 'On DUPLICATE KEY . . .".

Please explain.

Igor Ilic
  • 1,370
  • 1
  • 11
  • 21
Lemmy
  • 223
  • 2
  • 12
  • 3
    https://dev.mysql.com/doc/refman/8.0/en/insert-on-duplicate.html – Bernhard Feb 04 '19 at 08:52
  • 1
    Possible duplicate of ["INSERT IGNORE" vs "INSERT ... ON DUPLICATE KEY UPDATE"](https://stackoverflow.com/questions/548541/insert-ignore-vs-insert-on-duplicate-key-update) – Nico Haase Feb 04 '19 at 08:56
  • @Bernhard, can you please make me understand the meaning of "VALUES(column_name)" ? – Lemmy Feb 04 '19 at 09:10
  • @Nico, I must say some of you are expert at marking a question as 'duplicate' hastily even when it's clearly not. – Lemmy Feb 04 '19 at 10:17
  • That's something you have to explain: which exact parts of your question are not covered by the documentation linked by Bernhard (which should cover the basic parts) and the linked question (which covers the basics of that query form in the question itself and more deep explanations in the answers)? If you don't think that the other questions help you, you should provide more context to your question – Nico Haase Feb 04 '19 at 10:20

0 Answers0