SQL Server: What is the difference between CROSS JOIN and FULL OUTER JOIN?

前端 未结 10 1558
星月不相逢
星月不相逢 2020-11-28 18:38

What is the difference between CROSS JOIN and FULL OUTER JOIN in SQL Server?

Are they the same, or not? Please explain. When would one use either of these?

10条回答
  •  青春惊慌失措
    2020-11-28 19:31

    One thing that might not always be obvious to some is that a cross join with an empty table (or result set) results in empty table (M x N; hence M x 0 = 0)

    A full outer join will always have rows unless both M and N are 0.

提交回复
热议问题