I have two Unique keys in one table. I'm inserting the data from an csv file.
Unique keys are: enrollmentNo
and subjectCode
My query is:
Insert into result_stud_det(enrollmentNo,departmentCode,subjectCode,semester,marks,enrSubjCode) values (?,?,?,?,?,?) "
+ "ON DUPLICATE KEY UPDATE previousMarks=marks, marks=?;
The problem appeared when the data is updating. The "marks" updating in the end is remaining same. The first data on the csv file is copied down to every other column with unique enrollmentNo and to any subjectCodes. It is because it is looking for the unique key "enrollmentNo" only. What do I need to do so that the latest marks, "marks", doesn't have same value after updating it?