SELECT A.HRS_JOB_OPENING_ID ,B.LOCATION ,B.DESCR ,B.COUNTRY ,C.DESCR ,B.STATE ,D.DESCR ,B.CITY FROM PS_HRS_JOB_OPENING A , PS_LOCATION_TBL B ,PS_COUNTRY_TBL C ,PS_STATE_TBL D WHERE A.HRS_PRM_LOCATION=B.LOCATION AND B.COUNTRY= C.COUNTRY AND B.STATE=D.STATE AND C.COUNTRY=D.COUNTRY AND B.SETID=( SELECT G.SETID FROM PS_SET_CNTRL_GROUP G WHERE G.SETCNTRLVALUE = A.BUSINESS_UNIT AND G.REC_GROUP_ID = ( SELECT H.REC_GROUP_ID FROM PS_REC_GROUP_REC H WHERE H.RECNAME = 'LOCATION_TBL')) AND B.EFFDT = ( SELECT MAX(A.EFFDT) FROM PS_HRS_LOCATION_I A WHERE A.SETID = B.SETID AND A.LOCATION = B.LOCATION AND A.EFFDT <= %CurrentDateIn) AND ((D.COUNTRY = 'USA' AND D.NUMERIC_CD > ' ') OR (D.COUNTRY = 'CAN' AND D.NUMERIC_CD > ' ') OR D.COUNTRY NOT IN ('USA','CAN'))
|