I want to query 400 million pieces of data and save or modify them according to the content of each piece

Viewed 27

At present, there are about 400 million data in Table A, and the key fields are the mobile phone number and the C field. There are duplicates in the mobile phone number. Then compare each number found in Table A with the mobile phone number field in Table B. If the mobile phone number is duplicates, the C field will be updated, and if it is not, it will be added to Table B

Current practice: write a while loop, each loop from table A 3000 data, 3000 data in the loop, get each data look up table B for new or modified in turn

This method is too inefficient to process data. The for loop needs to check and change the library every time. Is there a better way to solve this problem? Please give advice or comments

0 Answers
Related