How to verify if two tables have exactly the same data?

前端 未结 8 701
梦毁少年i
梦毁少年i 2020-12-08 10:34

Basically, we have one table (original table) and it is backed up into another table (backup table); thus the two tables have exactly the same sche

8条回答
  •  我在风中等你
    2020-12-08 11:16

    You can just use CHECKSUM TABLE and compare the results. You can even alter the table to enable live checksums so that they are continuously available.

    CHECKSUM TABLE original_table, backup_table;
    

    It doesn't require the tables to have a primary key.

提交回复
热议问题