Jump to content

Updating records from a list


telguy08520

Recommended Posts

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  Carrier3
212-111      $.012      $.015    $.016
212-112      $.013      $.012    $.017
212-113      $.012      $.014    $.011
212-114      $.017      $.015    $.013

We receive weekly up dates from carriers which only contain the updated exchanges. So Carrier2 might send us the following file named 'Carrier2Update':
Exchange  Carrier2
212-111      $.014
212-114      $.018

We need to update the database from the new list. I WANT to do this:
UPDATE pricelist
SET pricelist.Carrier2=Carrier2Update.Carrier2
WHERE pricelist.exchange=Carrier2Update.exchange
FROM pricelist,Carrier2Update

But 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.
Link to comment
https://forums.phpfreaks.com/topic/27602-updating-records-from-a-list/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.