Hi Bikky,
I hope the following query will fullfil your requirement.
SEL
M.EMPNO AS MAIN_EMP,
M.EFF_DT AS MAIN_DT,
--L.TYPE_CD,
MAX(TYPE_CD) OVER(ORDER BY M.EFF_DT RESET WHEN TYPE_CD IS NOT NULL) AS NEW_TYPE_CD
FROM td3471.MAIN M LEFT JOIN td3471.LKP L ON M.EMPNO=L.EMPNO AND M.EFF_DT=L.EFF_DT;
Please let me know if I had missed anything.
Hi Bikky,
I hope the following query will fullfil your requirement.
Please let me know if I had missed anything.