salix/db/versions/.archive/10310-azureCymbidium/00-firstScript.sql

10 lines
299 B
SQL

-- 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;