When is a good situation to use a full outer join?

后端 未结 7 1555
耶瑟儿~
耶瑟儿~ 2020-12-23 02:07

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

相关标签:
7条回答
  • 2020-12-23 02:49

    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).

    0 讨论(0)
提交回复
热议问题