什么时候使用全外连接比较合适?

编程入门 行业动态 更新时间:2024-10-09 07:21:59
本文介绍了什么时候使用全外连接比较合适?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我总是不鼓励使用一种方法,但有没有一种情况是最好的方法?

I'm always discouraged from using one, but is there a circumstance when it's the best approach?

推荐答案

这很少见,但我有几个使用它的案例.通常在异常报告或 ETL 或其他双方都有数据的非常特殊的情况下您正在尝试合并.另一种方法是使用INNER JOIN、LEFT JOIN(右侧IS NULL)和RIGHT JOIN>(左侧 IS NULL)并执行 UNION - 有时这种方法更好,因为您可以更明显地自定义每个单独的连接(并添加派生列以指示哪个边是否找到,或者是否在两者中都找到了,哪一个会赢).

It's rare, but I have a few cases where it's used. Typically in exception reports or ETL or other very peculiar situations where both sides have data you are trying to combine. The alternative is to use an INNER JOIN, a LEFT JOIN (with right side IS NULL) and a RIGHT JOIN (with left side IS NULL) and do a UNION - sometimes this approach is better because you can customize each individual join more obviously (and add a derived column to indicate which side is found or whether it's found in both and which one is going to win).

更多推荐

什么时候使用全外连接比较合适?

本文发布于:2023-11-30 09:55:36,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1649568.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:什么时候   比较合适

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!