开发者

How to Determine Equality of Two Very Large Tables

开发者 https://www.devze.com 2023-01-02 14:05 出处:网络
I\'m using DB2 and I have two tables that have a million+ rows in them. Is there a query I can create that will check the two tables to see if all the values in the two are the same? Or, what is the b

I'm using DB2 and I have two tables that have a million+ rows in them. Is there a query I can create that will check the two tables to see if all the values in the two are the same? Or, what is the best way to do this?

Th开发者_如何学Pythonanks, Tyler


Use:

SELECT * 
  FROM TABLE_A
INTERSECT
SELECT *
  FROM TABLE_B

...assuming columns are identical. For more info on INTERSECT (and EXCEPT), see this article.

0

精彩评论

暂无评论...
验证码 换一张
取 消