Effective Dated Query

Ø  SELECT * FROM PS_JOB A WHERE A.EMPLID = 'KU0007' AND A.EFFDT = (SELECT MAX(B.EFFDT) FROM PS_JOB B
Ø  WHERE B.EMPLID = A.EMPLID AND B.EMPL_RCD = A.EMPL_RCD AND B.EFFDT<=SYSDATE)
Ø  AND A.EFFSEQ = (SELECT MAX(C.EFFSEQ) FROM PS_JOB C WHERE C.EMPLID = A.EMPLID and

Ø  C.EMPL_RCD = A.EMPL_RCD AND C.EFFDT = A.EFFDT)

Comments

Popular posts from this blog

BI Publisher: If Condition with sub-string in rtf template