>
> Besides that theoretical stuff, though, the real problem is that
> INSERT is for inserting new records into a database table. What
> you're trying to do is UPDATE existing records with new data. And
> there's no INSERT ... SELECT counterpart in the UPDATE syntax.
What about replace?
replace tablenamewithbaddata select * from tablenamewithgooddata;
It uses the unique index to decide whether or not to delete the old
records and insert, or to just insert the new record.
I would like more flexibility in replace but it might help with
this.
I would make copies of your tables before playing with this.
Dave
>
> What you probably need to do is write a program in some language
> (Perl, Python, C/C++) that can do some of the work for you. It's
> probably not going to be easy just using SQL statements.
>
> You might be able to get part of the way there by copying the good
> data into one table, the bad data into another, and merging the
> results, but it's not the way I'd approach the problem.
>
> > I'll not trust this task to anyone other than myself.
>
> Then why are you asking us? :-)
>
> Hope this helps in some way...
>
> Jeremy
> --
> Jeremy D. Zawodny, <[EMAIL PROTECTED]>
> Technical Yahoo - Yahoo Finance
> Desk: (408) 349-7878 Fax: (408) 349-5454 Cell: (408) 685-5936
>
> MySQL 3.23.41-max: up 4 days, processed 60,117,446 queries (139/sec. avg)
>
> ---------------------------------------------------------------------
> Before posting, please check:
> http://www.mysql.com/manual.php (the manual)
> http://lists.mysql.com/ (the list archive)
>
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail <[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php