Can this be made more efficient?
Posted: Fri Apr 20, 2007 6:25 pm
I have an old database that I'd like to update with new information.
-- I would like to compare 2 fields between two tables with about 90k rows each.
-- based on those comparisons, I'd like to UPDATE a field in one of the tables
Currently, I'm using this query, which has taken 1 hour already:
Is there something more efficient I can do to cut down on the time it takes?
-- I would like to compare 2 fields between two tables with about 90k rows each.
-- based on those comparisons, I'd like to UPDATE a field in one of the tables
Currently, I'm using this query, which has taken 1 hour already:
Code: Select all
UPDATE maintable, backuptable SET maintable.refnumber = backuptable.refnumber WHERE maintable.name=backuptable.name AND maintable.city=backuptable.city AND maintable.country=backuptable.country AND maintable.refnumber=0