You can UPDATE
the Customer
field of the second table Calendar
from the first table Customer
by JOIN
ing the two tables like so:
UPDATE calendar c1
INNER JOIN Customer c2 ON c1.SeatingID = c2.SeatingID AND c1.BusID = c2.BusID
SET c1.Customer = c2.ID --or SET c1.Customer = c2.PassengerName or whatever you want.
In the SET
clause, you can set the column you wish to update, and you can also JOIN
the two tables based on any predicate, I used c1.SeatingID = c2.SeatingID AND c1.BusID = c2.BusID
, but you can choose what is suitable for your needs.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…