三种解题方法

直接替换
update titles_test
set emp_no = replace(emp_no, 10001, 10005)
where id=5;

遇上重复key
INSERT INTO titles_test 
    VALUES(5, 10001 ,'Senior Engineer', '1986-06-26', '9999-01-01') 
    ON DUPLICATE KEY UPDATE emp_no = 10005;
 
遇上primary key或unique key时
REPLACE INTO titles_test
    VALUES(5, 10005 ,'Senior Engineer', '1986-06-26', '9999-01-01') ;