grippat Posted October 3, 2007 Share Posted October 3, 2007 I'm trying to figure out how to join two MySQL tables on a similar field in an update. I have one table "Companies" and another "Territories" that don't share an identical field, however they both have zip code fields. The one in Companies is 5 digits plus 4 like 12345-1234 and the one in Territories is just 5 digits like 12345. Is there a way I can do this? Would I be able to do something like this: UPDATE Companies coJOIN Territories trON tr.zipcode LIKE co.zip SET co cust_sales_rep = tr.sales_rep_id Link to comment Share on other sites More sharing options...
justsomeguy Posted October 3, 2007 Share Posted October 3, 2007 No, you can't use a join in an UPDATE statement. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.