UPDATE vn.ticketWeekly tw JOIN vn.ticket t ON t.id = tw.ticketFk JOIN vn.agencyMode am ON am.id = t.agencyModeFk SET tw.agencyModeFk = t.agencyModeFk WHERE am.name NOT LIKE '%turno%';