只需使用基于您的组合键的条件进行完全外部联接:
select t09.*, t10.*from table2009 as t09 full outer join table2010 as t10 on t09.k1 = t10.k1 and t09.k2 = t10.k2 and ...
如果只希望在结果集中看到不匹配的行(差异),则在
where子句中过滤它们:
where t09.k1 is null or t10.k1 is null

只需使用基于您的组合键的条件进行完全外部联接:
select t09.*, t10.*from table2009 as t09 full outer join table2010 as t10 on t09.k1 = t10.k1 and t09.k2 = t10.k2 and ...
如果只希望在结果集中看到不匹配的行(差异),则在
where子句中过滤它们:
where t09.k1 is null or t10.k1 is null