update spawnlist,locations set spawnlist.loc_id=locations_loc_id where spawnlist.locx=0 and spawnlist.locy=0 and spawnlist.loc_name=locations.off_loc_name; spawnlist.loc_name is a varchar string locations.off_loc_name also varchar spawnlist have ~22k records locations have ~30k records