UPDATE tab1 as t1 INNER JOIN tab2 as t2 ON t1.sampleId= t2.sampleId set t1.TaskCon='4' where t2.GroupCode='5814344' AND t1.taskCon = '6'