MySQL Forums
Forum List  »  Newbie

UPDATE Table 1 with JOIN Table 2
Posted by: kate willson
Date: July 27, 2015 10:22PM

I am trying to update a column in one table (a last name) with corresponding data from a second table (also a last name)

I am trying to get the query to dump the corresponding data into a bank column called 'hispanic" and tag it as "H."

Here is what my query looks like:

UPDATE `doc_may2015_2_narrow`
JOIN `boscoe_surnamelist_90`
ON doc_may2015_2_narrow.namel = boscoe_surnamelist_90.name1
SET doc_may2015_2_narrow.hispanic = 'H'

I'm not getting an error message but my query either times out (MySLQWokbench) or Runs for hours without producing results (Sequel Pro).

Perhaps a better way yo update the table would be to duplicate the existing column and write an update on that instead of trying to populate a new column?

Options: ReplyQuote


Subject
Written By
Posted
UPDATE Table 1 with JOIN Table 2
July 27, 2015 10:22PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.