telguy08520 Posted November 17, 2006 Share Posted November 17, 2006 I think I am missing something obvious in MySQL.We have large databases of telephone exchanges and pricing set up in the following format (simplified here for brevity):Database name is 'pricelist'-Exchange Carrier1 Carrier2 Carrier3212-111 $.012 $.015 $.016212-112 $.013 $.012 $.017212-113 $.012 $.014 $.011212-114 $.017 $.015 $.013We receive weekly up dates from carriers which only contain the updated exchanges. So Carrier2 might send us the following file named 'Carrier2Update':Exchange Carrier2212-111 $.014212-114 $.018We need to update the database from the new list. I WANT to do this:UPDATE pricelistSET pricelist.Carrier2=Carrier2Update.Carrier2WHERE pricelist.exchange=Carrier2Update.exchangeFROM pricelist,Carrier2UpdateBut update does not permit me to access the update list from another table.There must be a simple way to do this, but I am hitting a mental block on this.Any help would be appreciated. Quote Link to comment Share on other sites More sharing options...
telguy08520 Posted November 17, 2006 Author Share Posted November 17, 2006 The answer is obviously:update pricelist,carrier2updateset pricelist.carrier2=carrier2update.carrier2when pricelist.exchange=carrier2update.exchangeNeed sleep Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.