更新时间:2023-02-07 14:06:38
这看起来像左连接
和条件逻辑:
This looks like a left join
and conditional logic:
select
t.id,
coalesce(t.col1, t1.col1) col1,
coalesce(t.col2, t1.col2) col2,
coalesce(t.col3, t1.col3) col3,
t.source_id
from mytable t
left join mytable t1 on t1.id = t.source_id