SELECT DISTINCT a.rb_wf_grp_name , a.userid ,b.oprdefndesc FROM ps_rd_wrkr_job j ,PS_RD_PER_GRPWL_VW a ,PSOPRDEFN b WHERE j.effdt = ( SELECT MAX(effdt) FROM ps_rd_wrkr_job a1 WHERE a1.person_id = j.person_id AND a1.wrkr_asgn_seq = j.wrkr_asgn_seq AND a1.effdt <= %CurrentDateIn) AND j.effseq = ( SELECT MAX(effseq) FROM ps_rd_wrkr_job b1 WHERE b1.person_id = j.person_id AND b1.wrkr_asgn_seq = j.wrkr_asgn_seq AND effdt =j.effdt ) AND a.userid = b.oprid AND j.PERSON_ID = a.PERSON_ID AND j.empl_status = 'A'
|