您好, 欢迎来到 !    登录 | 注册 | | 设为首页 | 收藏本站

使用左外部联接联接两个表,并根据右表列填充新的列值

使用左外部联接联接两个表,并根据右表列填充新的列值

我认为您需要一个累积的最大窗口函数

select id, week_end_date, exam_completed_date,
       max(exam_completed_date) over (partition by id order by week_end_date) as newcolumn
from emp_table emp left outer join
     exam_table exam 
     on exam.id=emp.id and
        exam.exam_completed_date = emp.week_end_date
where id = 0;
其他 2022/1/1 18:53:29 有427人围观

撰写回答


你尚未登录,登录后可以

和开发者交流问题的细节

关注并接收问题和回答的更新提醒

参与内容的编辑和改进,让解决方法与时俱进

请先登录

推荐问题


联系我
置顶