如何证明表B中存在所有查询A中的所有记录,以获取数百万记录?
我编写了查询(在Microsoft SQL Server Management Studio V18中),该工作室进行了多个内部连接,以提供3列的结果:ZipCode,ID,收入。
该结果集包含1.18亿条记录
I具有2列的表B:ZipCode,ID
表B包含1.23亿记录,
表B中存在这些1.18亿记录,我想证明这一点。 我该怎么做?我不希望另一个结果集将所有这1.18亿记录在输出控制台上显示。
我可以在临时表中添加第一个结果设置,但是在那之后我被卡住了。 理想情况下,我希望看到在控制台上打印的东西,这些内容将说“临时表中的所有记录都存在于target表中< table_name>''
如果没有,什么可以证明所有这些记录都存在于目标表中的理想方式?
I have query written (in Microsoft SQL Server Management Studio V18) which does multiple inner joins to give result set with 3 columns: ZipCode, ID, Income.
This result set contains 118 Million records
I have Table B with 2 columns: ZipCode, ID
Table B contains 123 Million records
These 118M records are present in Table B and I want to prove that.
How do I do this? I don't want another resultset that will display all these 118M records on the output console.
I can add first result set in a temp table but I am stuck after that.
Ideally I would like to see something printed on the console that will say that "All the records from temp table are present in target table<Table_Name>"
If not, what could be an ideal way to prove that all these records are present in target table?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
因此,在说您将查询结果推到temp表中说#a之后,我们可以按照以下
so after say you have pushed your query results into temp table say #a, we can proceed like below
然后替换您的查询ta和tb。
Then replace by your queries TA and TB.