Home > database >  Check the problem data
Check the problem data

Time:09-26

Ask a question, there are two tables in the database, the field structure and data base is the same, is there any way to verify the two table data is consistent, there are differences according to come out

CodePudding user response:

Do two libraries a library into a table and master-slave synchronization and use pt - table - checksum check two tables

CodePudding user response:

Suppose A table and B table,
The following query A exist, but data table does not exist, B
SELECT A. * FROM A WHERE the EXISTS (SELECT 0 FROM the WHERE b. B field 1=a. field 1 AND b. field 2=a. field 2... Subsequent all fields need than to write,)
Similarly, you can query B, A, there is no data,

CodePudding user response:

Pt - table - checksum to verify whether two table data is consistent,

CodePudding user response:

SQL statements can be implemented,
  • Related