For more information, please refer to this announcement explaining best practices for getting answers to questions.
Query to extract employee grade ladder in the assignment page
Summary:
Content (please ensure you mask any confidential information):
Hello experts,
we built the following query to retrieve the employee current grade ladder.
However, the query returns more rows for the same employee, while we expect to extract just the current one (one row for each employee).
What's wrong with this query? How could I adjust it?
SELECT DISTINCT GL.NAME as BAND, PN.DISPLAY_NAME as WORKER_NAME, ASG.ASSIGNMENT_NUMBER, PEOPLE.PERSON_NUMBER
FROM PER_ALL_ASSIGNMENTS_M ASG
INNER JOIN PER_GRADES_IN_LADDERS_F GIN ON (ASG.GRADE_ID=GIN.GRADE_ID AND TRUNC(SYSDATE) BETWEEN TRUNC(GIN.EFFECTIVE_START_DATE) AND TRUNC(GIN.EFFECTIVE_END_DATE))