salix/db/versions/10738-greenCordyline/01-copyDataToTravel.sql

10 lines
275 B
MySQL
Raw Normal View History

2024-01-25 16:33:54 +00:00
UPDATE vn.travel t
JOIN(SELECT t.id travelFk, d.awbFk
FROM vn.dua d
JOIN vn.duaEntry de ON de.duaFk = d.id
JOIN vn.`entry` e ON e.id = de.entryFk
JOIN vn.travel t ON t.id = e.travelFk
GROUP BY t.id
)sub ON sub.travelFk = t.id
SET t.awbFk = sub.awbFk;