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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.