It is not recommended to use a SQL statement to solve this kind of problem, because the database cannot afford it. It can be implemented using a program (such as writing a Python script). The steps are as follows:
Copy the table structure of table A (80 million rows) to generate an empty table B;
Make a unique index on the ciphertext column of B;
Traverse each row of table A and insert it into table B. You can use REPLACE或INSERT INTO ... ON DUPLICATE KEY UPDATE ...
Verify the data in table B. If the result is correct, delete table A and rename table B to table A.
It is not recommended to use a SQL statement to solve this kind of problem, because the database cannot afford it. It can be implemented using a program (such as writing a Python script). The steps are as follows:
Copy the table structure of table A (80 million rows) to generate an empty table B;
Make a unique index on the ciphertext column of B;
Traverse each row of table A and insert it into table B. You can use
REPLACE
或INSERT INTO ... ON DUPLICATE KEY UPDATE ...
Verify the data in table B. If the result is correct, delete table A and rename table B to table A.