Friday, 4 July 2014

Query to display Compentencies related to Employee

/* Formatted on 7/4/2014 11:16:24 AM (QP5 v5.115.810.9015) */
SELECT pap.person_id,
       pap.full_name appraiser,
       pc.name compentency,
       NVL2 (prl1.name, prl1.step_value || '-' || prl1.name, prl1.step_value)
          AS emp_prof_level,
       pce.comments,
       prl1.step_value
FROM per_competence_elements pce,
     per_rating_levels_vl prl1,
     per_rating_levels_vl prl2,
     per_rating_levels_vl prl3,
     per_all_people_f pap,
     per_competences pc
WHERE     pce.proficiency_level_id = prl1.rating_level_id(+)
      AND pce.rating_level_id = prl2.rating_level_id(+)
      AND pce.weighting_level_id = prl3.rating_level_id(+)
      AND object_id = pap.person_id
      AND pc.competence_id = pce.competence_id
      AND TRUNC (SYSDATE) BETWEEN pap.effective_start_date
                              AND  effective_end_date
      AND pce.object_name = 'ASSESSOR_ID'
      AND pce.object_id IN
               (SELECT perp.person_id
                FROM per_participants perp, per_assessments pass
                WHERE     perp.participation_in_id = pass.appraisal_id
                      AND perp.participation_in_table = 'PER_APPRAISALS'
                      AND perp.participation_in_column = 'APPRAISAL_ID'
                      AND pass.assessment_id = pce.assessment_id
                      AND pass.appraisal_id = 74515---(Appraisal id receieved from previous query)
               );

1 comment:

  1. A very informative and practical article that demonstrates how SQL queries can be effectively used to retrieve and organize competency-related data for better reporting and analysis. The approach provides valuable insights for HR and database professionals by simplifying the process of accessing meaningful competency information. This type of structured data analysis can support smarter decision-making, talent management, and efficient workforce planning. Great work in sharing a useful technical solution with real-world business relevance.
    Digital Solutions Company Australia
    Premium Sports Facility
    build 2 trade

    ReplyDelete