Você está na página 1de 4

Find the List Users that have a particular Responsibility

select
rg.user_id,fu.user_name,ppf.employee_number,ppf.full_name,rt.responsibility_name
from fnd_responsibility_tl rt,FND_USER_RESP_GROUPS_DIRECT rg,fnd_user fu,
per_all_people_f ppf
where upper(RESPONSIBILITY_NAME) like %APPROVALS MANAGEMENT BUSINESS
ANALYST
and rt.RESPONSIBILITY_ID = rg.RESPONSIBILITY_ID
and rg.user_id = fu.user_id
and fu.employee_id = ppf.person_id
and trunc(sysdate) between ppf.effective_start_date and ppf.effective_end_date
Core HR Queries

Find total Active employee in the company

select ppf.employee_number,ppf.full_name,ppf.email_address
from per_all_people_f ppf
where ppf.current_employee_flag = Y
and trunc(sysdate) between ppf.effective_start_date and ppf.effective_end_date
and ppf.employee_number is not null
and ppf.person_type_id = ( select person_type_id
from per_person_types
where user_person_type = Employee
and business_group_id = ppf.BUSINESS_GROUP_ID
)
Get Month Wise Hired Employees Head Count

select to_char(ORIGINAL_DATE_OF_HIRE,MON) MM, COUNT(PERSON_ID) TOTAL


from per_people_x
WHERE to_char(ORIGINAL_DATE_OF_HIRE,RRRR) = 2014

group by to_char(ORIGINAL_DATE_OF_HIRE,MON)

Provide a List of Active Employees along with their Supervisors Name and email
address
select ppf.employee_number,ppf.full_name,ppf.email_address
,paaf.supervisor_id,sup.full_name,sup.email_address
from per_all_people_f ppf,per_all_assignments_f paaf,per_people_x sup
where ppf.current_employee_flag = Y
and paaf.supervisor_id (+) = sup.person_id
and trunc(sysdate) between ppf.effective_start_date and ppf.effective_end_date
and trunc(sysdate) between paaf.effective_start_date and paaf.effective_end_date
and ppf.person_id = paaf.person_id
and ppf.employee_number is not null
and ppf.employee_number = 539988
and ppf.person_type_id = ( select person_type_id
from per_person_types
where user_person_type = Employee
and business_group_id = ppf.BUSINESS_GROUP_ID
)

Get the Employee Salary Increase Summary

select ppf.employee_number,ppf.full_name,ppp.proposed_salary_n,ppp.change_date
from per_pay_proposals ppp,per_all_people_f ppf,per_all_assignments_f paaf
where ppf.person_id = paaf.person_id
and paaf.assignment_id = ppp.assignment_id
and ppf.employee_number = 603167
and trunc(sysdate) between ppf.effective_start_date and ppf.effective_end_date
and trunc(sysdate) between paaf.effective_start_date and paaf.effective_end_date
and ppp.approved = Y

and change_date = (select min(change_date) from per_pay_proposals where


assignment_id = ppp.assignment_id and proposed_salary_n =
ppp.proposed_salary_n)
order by ppp.change_date desc

Get the History for An Employees Transfers in the company

Get the list of employee who were terminated and have been rehired

select ppf.employee_number,ppf.full_name,ppf.email_address
from per_all_people_f ppf
where trunc(sysdate) between ppf.effective_start_date and ppf.effective_end_date
and person_id in
( select person_id
from (
select count(1),person_id
from per_periods_of_service
group by person_id
having count(1) > 1
)
)
Get the List of Terminated Employees

select ppf.employee_number,ppf.full_name,ppf.email_address
from per_all_people_f ppf
where trunc(sysdate) between ppf.effective_start_date and ppf.effective_end_date
and current_employee_flag is null
and ppf.person_type_id = ( select person_type_id
from per_person_types
where user_person_type = Ex-employee

and business_group_id = ppf.BUSINESS_GROUP_ID


)

Você também pode gostar