First get the score for tables C1 and C2. C1 and C2 must be equal. C1 and C2 are available upon request
select count(*) from table1
if C1 and C2 are not equal, then the tables are not identical.
2: Find a different counter for tables DC1 and DC2. DC1 and DC2 must be equal. The number of different entries can be found using the following query:
select count(*) from (select distinct * from table1)
if DC1 and DC2 are not equal, the tables are not identical.
3: Now get the number of records obtained by joining two tables. Let it be U. Use the following query to get the number of records in a join of 2 tables:
SELECT count (*) FROM (SELECT * FROM table1 UNION SELECT * FROM table2)
We can say that the data in 2 tables are identical if the different number for 2 tables is equal to the number of records obtained by combining the two tables. those. DC1 = U and DC2 = U
source share