MySQL Forums
Forum List  »  Newbie

Update Table With Select Results
Posted by: Duane Mitchell
Date: August 10, 2017 09:12AM

Not sure the best way to do this or if it's possible. Here's a summary.

I create a temporary table from a tab delimited text file. First row is columns and that is never the same from file to file. There just 3 columns that must be there they are Fname, Lname, and State columns. Let's say it's 1000 rows. This table is run against the existing db using a join to find a match on Fname, Lname, and State. Let's say if finds 500 matches.

The temporary table has an ALTER executed to add some columns. The data from the JOIN needs to go into those columns for the correct rows.

Right now I'm bringing the join results down to the client app and then updating from there. Takes a long time even for 500 records.

If I understand INSERT INTO then I need to know the columns for the row I'm updating and they have to be the same. What I want to do is what I'm doing now in the client app but do it in SQL because it's faster.


Options: ReplyQuote

Written By
Update Table With Select Results
August 10, 2017 09:12AM

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.