-- UPDATE asociado a la tarea USE vn; UPDATE vn.worker w JOIN(SELECT r.workerFk FROM route r LEFT JOIN workerLabour wl ON wl.workerFk = r.workerFk WHERE wl.workerFk IS NULL AND r.workerFk IS NOT NULL GROUP BY r.workerFk) sub ON sub.workerFk = w.id SET w.isFreelance = TRUE;