Search This Blog

Saturday, November 25, 2017

Salary Query

SELECT   papf.person_number
        ,TO_CHAR(cs.date_to,'YYYY/MM/DD') date_to
        ,to_char(cs.date_from,'YYYY/MM/DD') date_from
FROM     cmp_salary cs
        ,cmp_salary_bases csb
        ,per_all_assignments_m paam
        ,per_all_people_f papf
WHERE        cs.salary_basis_id = csb.salary_basis_id
         AND paam.assignment_id = cs.assignment_id
         AND paam.effective_latest_change = 'Y'
         AND paam.primary_assignment_flag = 'Y'
         AND TRUNC (SYSDATE) BETWEEN paam.effective_start_date
                                 AND paam.effective_end_date
         AND papf.person_id = paam.person_id
         AND TRUNC (SYSDATE) BETWEEN papf.effective_start_date
                                 AND papf.effective_end_date
ORDER BY LPAD (papf.person_number

No comments:

Post a Comment