Jump to content

Merging similar columns from different databases...


Jim R

Recommended Posts

I'm hoping writing down my issue will help me find the logic in it.  I have two tables in two different databases that are essentially the same.  I've updated each separately at different times without remembering I had two of them.  Now I'm trying to merge information from the email columns.

 

These are coaching jobs which have changed since last year.  There were around 90 changes.

 

I'm trying to move the emails I have in t2 that I don't have in t1.  I have NULL cells in both columns, and I don't want to overwrite emails I already have in t1 with NULL cells I have in t2. 

 

I need something that Sets t1.email Where t1.email isn't equal to t2.email and t2.email Is Not Null.  (I should have done this before I changed the coaches' names.  I could have used that as a trigger.) 

 

Would that be the logic?  I definitely need help with the syntax.

 

UPDATE jwrbloom_hhr.hhr_schools t1 
JOIN jwrbloom_hhm.schools t2 
ON t1.id = t2.id
SET t1.email = t2.email
WHERE ??????

 

 

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.