select * from 增量表 union All (select * from 原始表 where emp_id not in (select emp_id from 增量表));
全量= 增量 + (原始-增量中更新的)
应该没问题了,你试试,做题应该没什么问题,要是真实项目这样可能性能不高。等一个大神出手
select
*
from 增量表
union All
(select
*
from 原始表
where emp_id not in (select emp_id from 增量表))
union ALL
(SELECT
*
FROM 增量表 LEFT JOIN 原始表 ON 增量表.emp_id = 原始表.emp_id
);