答案 0 :(得分:1)
我认为值是列4,5,6必须是T1和T2的总和:
SELECT
t1.No, t1.Month, t1.Salary + t2.Salary,
( t1.PresenceTime + t2.PresenceTime ) AS PresenceTime,
( t1.AbsencePaidTime + t2.AbsencePaidTime ) AS AbsencePaidTime,
( t1.PresenceTargetTime + t2.PresenceTargetTime ) AS PresenceTargetTime
FROM TABLE1 t1 JOIN TABLE2 t2 ON t1.No=t2.No AND t1.Month=t2.Month;
不确定仅No
或Month
上的加入是否足够。
答案 1 :(得分:0)
这不是您需要的联接,而是UNION。你可以做到
SELECT * FROM TABLE1
UNION
SELECT * FROM TABLE2