Guest User

Untitled

a guest
Jan 18th, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. UPDATE calendar c1
  2. INNER JOIN Customer c2 ON c1.SeatingID = c2.SeatingID AND c1.BusID = c2.BusID
  3. SET c1.Customer = c2.ID --or SET c1.Customer = c2.PassengerName or whatever you want.
  4.  
  5. UPDATE calendar cal, customer cust
  6. SET cal.Customer = cust.ID
  7. where cal.SeatingID = cust.SeatingID
  8. and cal.BusID = cust.BusID
  9. and cal.DATE = cust.DateOfTravel;
  10.  
  11. update calendar ca left join customer c
  12. on c.DateofTravel=ca.Date and c.SeatingID=ca.SeatingID and c.BusID=ca.BusID
  13. set
  14. ca.Customer=c.ID;
Add Comment
Please, Sign In to add comment