加入与2个表不同 [英] Join distinct from 2 tables

查看:102
本文介绍了加入与2个表不同的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我是新手,我希望你能解决我的问题。


我有2个表T1和T2,每行有数百万行。


它们都有列模式(总共大约100模式值)


我想得到一个T1和T2的模式的不同值。


然后合并2个不同的模式以查看有多少重叠,T1中有多少重叠,T2中有多少重叠。


您可以帮我解释一下代码吗?


非常感谢您的帮助。


HN


解决方案


您好,


我是新手,我希望你能解决我的问题。


我有2个表T1和T2,每个表有数百万行。


它们都有列模式(总共大约100模式值)


我想获得T1和T2的模式的明显值。


然后合并2个不同的模式,看看有多少重叠,T1中有多少重叠,T2中有多少重叠。


您可以帮我解释一下代码吗?


非常感谢您的帮助。


HN



美好的一天  Harry


请提供查询以创建您的表格,包括您拥有的任何索引。


如果如果您在distinct列上没有索引,那么您可能需要创建一个索引以提高性能,并避免在每次需要执行查询时读取所有行。


 


Hi,

I am new to the field and I hope you can help me with my problem.

I have 2 table T1 and T2, each with millions rows.

Both of them have column Mode (total about 100 Mode value)

I want to get a distinct value of Mode for T1 and for T2.

Then merge the 2 distinct modes to see how many overlap, how many only in T1 and how many in T2.

Can you please help me with the code?

Thank you so much for your help.

HN

解决方案

Hi,

I am new to the field and I hope you can help me with my problem.

I have 2 table T1 and T2, each with millions rows.

Both of them have column Mode (total about 100 Mode value)

I want to get a distinct value of Mode for T1 and for T2.

Then merge the 2 distinct modes to see how many overlap, how many only in T1 and how many in T2.

Can you please help me with the code?

Thank you so much for your help.

HN

Good day Harry,

Please provide the queries to create your table including any index you have.

If you don't have index on the distinct column then you might need to create one in order to improve performance and avoid reading all the rows each time you need to execute the query.

 


这篇关于加入与2个表不同的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆