开发者

How to Determine Equality of Two Very Large Tables

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜