Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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.
- UPDATE calendar cal, customer cust
- SET cal.Customer = cust.ID
- where cal.SeatingID = cust.SeatingID
- and cal.BusID = cust.BusID
- and cal.DATE = cust.DateOfTravel;
- update calendar ca left join customer c
- on c.DateofTravel=ca.Date and c.SeatingID=ca.SeatingID and c.BusID=ca.BusID
- set
- ca.Customer=c.ID;
Add Comment
Please, Sign In to add comment