java - Table is not updating, help is appreciated. I used same syntax for updating other tables, but this one is not working -


this sql query not updating database, instead returning error. suggestions?

preparedstatement ps10 = con.preparestatement("update payroll_system.payslip set hours_worked = (select sum(hours) payroll_system.monthly_timesheet employeeid=?) employeeid=?");                     ps10.setstring(1, employee_id);                     ps10.setstring(2, employee_id);                     ps10.executeupdate(); 

enter image description here

enter image description here

try this:

update payroll_system.payslip t1      set hours_worked = (select sum(hours) payroll_system.monthly_timesheet employeeid=t1.employeeid)      employeeid=? 

Comments