View Single Post
Old 03-23-2014, 08:11 PM  
sarettah
see you later, I'm gone
 
Industry Role:
Join Date: Oct 2002
Posts: 14,078
Quote:
Originally Posted by mkx View Post
I have 3 mysql tables

table1 =
orderid,shippingmethod

table2 =
transactionid,orderid

table3 =
transactionid,shipmethod2

I want to update all of table 1's shippingmethod to show the shipmethod2 from table 3

Can anyone post the code to do this? I am getting a bit confused
update table_1 a inner join table_2 b on a.orderid=b.orderid inner join table_3 c on b.transactionid=c.transactionid set a.shippingmethod=c.shipmethod2

Should do it.

.
__________________
All cookies cleared!
sarettah is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote