SELECT J.COMPANY , J.EMPLID , A.REG_ESOCIAL_BRA , J.EMPL_RCD , J.HIRE_DT , CATEG_CD.GPBR_LABOR_CAT_CD , CATEG_CD.DESCR50 FROM PS_ADDL_INFO_BRA A , PS_JOB J , PS_GPBR_LBR_REGIME LBR , PS_GPBR_L_CAT_CODE CATEG_CD WHERE A.EMPLID = J.EMPLID AND A.EMPL_RCD = J.EMPL_RCD AND J.EFFDT = ( SELECT MAX(JJ.EFFDT) FROM PS_JOB JJ WHERE JJ.EMPLID = J.EMPLID AND JJ.EMPL_RCD = J.EMPL_RCD AND JJ.EFFDT <= A.EFFDT) AND LBR.SETID = J.SETID_EMPL_CLASS AND LBR.EMPL_CLASS = J.EMPL_CLASS AND LBR.EFFDT = ( SELECT MAX(LBR2.EFFDT) FROM PS_GPBR_LBR_REGIME LBR2 WHERE LBR2.SETID = LBR.SETID AND LBR2.EMPL_CLASS = LBR.EMPL_CLASS AND LBR2.EFFDT <= J.EFFDT) AND CATEG_CD.GPBR_LABOR_CAT_CD = LBR.GPBR_LABOR_CAT_CD AND CATEG_CD.EFFDT = ( SELECT MAX(CATEG_CD2.EFFDT) FROM PS_GPBR_L_CAT_CODE CATEG_CD2 WHERE CATEG_CD.GPBR_LABOR_CAT_CD = CATEG_CD2.GPBR_LABOR_CAT_CD AND CATEG_CD2.EFFDT <= J.EFFDT)
|