如何根据两个表中的 2 列创建第 3 列 [内部和外部联接]

How to create a 3rd column based on 2 columns from two tables [inner and outer join]

My problem is that I want to make a third date-column that will use the dates from table beta if they are not null. If they are null, it should use the dates from table alpha.

因为您没有提供任何关于您的数据模型的信息。我已经根据你的问题给了你一个粗略的草稿。

Select 
colA,
colB,
...,
alpha.date1,
beta.date2,
COALESCE(beta.date2,alpha.date1) date3
from 
alpha
left outer join beta (your keys)

由于您没有提供任何好的数据示例(数据库模式)和预期结果

这是我的方法:

SELECT 
   a.date,
   COALESCE(b.mycolumn, a.mycolumn)
FROM alpha a
LEFT JOIN beta b
ON a.date = b.date