两种拉链表的思路

1、如果没有物理删除,可以直接取增量数据, 1 union全量数据,0,然后对id取row number partition by id order by sequenceid desc, 取rn=1的数据作为镜像

2、如果有物理删除,则需要查看主表哪些customeruid变动了,就查出相应的customerext

然后合并:取Base表left join customer 新的customeruid where 新customeruid is null ,

然后union base表和增量数据。

这样下来不需要row number,而是需要找出customeruid没有改变的,union上改变了的。

好处是可以获取删除的条目,坏处是需要更新的数据量更大。

原文地址:https://www.cnblogs.com/yjybupt/p/14485186.html