-
Notifications
You must be signed in to change notification settings - Fork 0
/
Invalid ASG-BU for PosSynch.sql
25 lines (24 loc) · 1.09 KB
/
Invalid ASG-BU for PosSynch.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
-- obsolete
SELECT DISTINCT PAPF.PERSON_NUMBER "PersonNumber"
, TO_CHAR(PAAM.EFFECTIVE_START_DATE, 'YYYY/MM/DD') "MinEffectiveStartDate"
, HOUFT_LE.NAME "LegalEmployerName"
FROM PER_ALL_ASSIGNMENTS_M PAAM
, PER_PERIODS_OF_SERVICE PPOS
, HR_ORGANIZATION_UNITS_F_TL HOUFT_LE
, HR_ALL_POSITIONS_F HAPF
, PER_ALL_PEOPLE_F PAPF
WHERE 1 = 1
AND PAAM.PERSON_ID = PAPF.PERSON_ID
AND PAAM.PERSON_ID = PPOS.PERSON_ID
AND PPOS.LEGAL_ENTITY_ID = HOUFT_LE.ORGANIZATION_ID
AND PAAM.BARGAINING_UNIT_CODE NOT IN (SELECT DISTINCT FLVB.LOOKUP_CODE
FROM FND_LOOKUP_VALUES_B FLVB
WHERE 1 = 1
AND FLVB.LOOKUP_TYPE = 'BARGAINING_UNIT_CODE')
AND PAAM.EFFECTIVE_START_DATE = (SELECT MIN(PAAM2.EFFECTIVE_START_DATE) FROM PER_ALL_ASSIGNMENTS_M PAAM2 WHERE 1 = 1 AND PAAM.ASSIGNMENT_ID = PAAM2.ASSIGNMENT_ID)
AND PAAM.POSITION_ID = HAPF.POSITION_ID
AND HAPF.BARGAINING_UNIT_CD IN (SELECT DISTINCT FLVB.LOOKUP_CODE
FROM FND_LOOKUP_VALUES_B FLVB
WHERE 1 = 1
AND FLVB.LOOKUP_TYPE = 'BARGAINING_UNIT_CODE')
ORDER BY HOUFT_LE.NAME, TO_CHAR(PAAM.EFFECTIVE_START_DATE, 'YYYY/MM/DD')