0% found this document useful (0 votes)
87 views2 pages

Hrms Basic Salary Final Query

This SQL query selects employee data from various HR tables, including employee number, name, designation, location, grade ladder, and proposed salary. It joins tables for people, assignments, pay proposals, grades, and locations. The query filters for current employees in a specific business group and returns both employees with and without current pay proposals.

Uploaded by

Doifode Pralhad
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
87 views2 pages

Hrms Basic Salary Final Query

This SQL query selects employee data from various HR tables, including employee number, name, designation, location, grade ladder, and proposed salary. It joins tables for people, assignments, pay proposals, grades, and locations. The query filters for current employees in a specific business group and returns both employees with and without current pay proposals.

Uploaded by

Doifode Pralhad
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

select

pap.EMPLOYEE_NUMBER,
pap.FULL_NAME,
pg.name Designation,
hla.location_code ofc_location_branch_name,
decode(pas.grade_ladder_pgm_id,'','grade_ladder_not_attached',pas.grade_ladder_p
gm_id) grade_ladder,
ppp.PROPOSED_SALARY_n Basi_Salary
from per_all_people_f pap,
per_all_assignments_f pas,
PER_PAY_PROPOSALS ppp,
per_grades pg,
hr_locations_all hla
where pap.PERSON_ID=pas.PERSON_ID
and pas.ASSIGNMENT_ID=ppp.ASSIGNMENT_ID
AND pg.grade_id(+) = pas.grade_id
AND hla.location_id(+) = pas.location_id
and pap.EMPLOYEE_NUMBER is not null
and sysdate between pap.EFFECTIVE_START_DATE and pap.EFFECTIVE_END_DATE
and sysdate between pas.EFFECTIVE_START_DATE and pas.EFFECTIVE_END_DATE
and pap.business_group_id = 81
AND ppp.pay_proposal_id in (SELECT MAX (pay_proposal_id)FROM per_pay_proposals W
HERE assignment_id(+) = pas.assignment_id)
and pap.current_employee_flag = 'Y'
UNION ALL
select
pap.EMPLOYEE_NUMBER,
pap.FULL_NAME,
pg.name Designation,
hla.location_code ofc_location_branch_name,
decode(pas.grade_ladder_pgm_id,'','grade_ladder_not_attached',pas.grade_ladder_p
gm_id) grade_ladder,
null Basi_Salary
from per_all_people_f pap,
per_all_assignments_f pas,
per_grades pg,
hr_locations_all hla
where pap.PERSON_ID=pas.PERSON_ID
AND pg.grade_id(+) = pas.grade_id
AND hla.location_id(+) = pas.location_id
and pap.EMPLOYEE_NUMBER is not null
and sysdate between pap.EFFECTIVE_START_DATE and pap.EFFECTIVE_END_DATE
and sysdate between pas.EFFECTIVE_START_DATE and pas.EFFECTIVE_END_DATE
and pap.business_group_id = 81
and pap.current_employee_flag = 'Y'
and pap.PERSON_ID not in (select pap.PERSON_ID
from per_all_people_f pap,
per_all_assignments_f pas,
PER_PAY_PROPOSALS ppp,
per_grades pg,
hr_locations_all hla
where pap.PERSON_ID=pas.PERSON_ID
and pas.ASSIGNMENT_ID=ppp.ASSIGNMENT_ID
AND pg.grade_id(+) = pas.grade_id
AND hla.location_id(+) = pas.location_id
and pap.EMPLOYEE_NUMBER is not null
and sysdate between pap.EFFECTIVE_START_DATE and pap.EFFECTIVE_END_DATE
and sysdate between pas.EFFECTIVE_START_DATE and pas.EFFECTIVE_END_DATE
and pap.business_group_id = 81
AND ppp.pay_proposal_id in (SELECT MAX (pay_proposal_id)FROM per_pay_proposals W

HERE assignment_id(+) = pas.assignment_id)


and pap.current_employee_flag = 'Y'
)
;

You might also like