the thing is, i have a table students table and another scores table and i already have all the students in the scores table but the class field is still empty so, i thought i could update all of them with the data from the the students table. each students with his/her class.
UPDATE scores_tbl
INNER JOIN students_tbl
ON scores_tbl.reg_id = students_tbl.reg_id
SET scores_tbl.class = IF(students_tbl.class > 0, students_tbl.class, scores_tbl.class)
WHERE scores_tbl.session ="2018/2019";
am displayed with: Truncated incorrect DOUBLE value
2
Answers
try this
You may try this. Since you only want to update the record if
student_tbl.class
has any value. It is better to write this condition in where clause and simplify your query.I am expecting that class column has only integer values.