Here's my sample input tables:
employee_id | project | effective_date** |
---|---|---|
1 | A | 2014-08-13 |
1 | B | 2016-12-21 |
1 | C | 2018-02-21 |
employee_id | designation | effective_date |
---|---|---|
1 | trainee | 2014-08-05 |
1 | senior | 2016-08-17 |
1 | team leader | 2018-02-05 |
Table1: describes an employee who undergoes different projects at different date's in an organization.
Table2: describes the same employee from Table1 who undergoes different designation in the same organisation.
Now I want an Expected output table like this:
employee_id | project | designation | effective_date |
---|---|---|---|
1 | A | trainee | 2014-08-13 |
1 | A | senior | 2016-08-17 |
1 | B | Senior | 2016-12-21 |
1 | B | team leader | 2018-02-05 |
1 | C | team leader | 2018-02-21 |
The fact is that whenever:
- his project changes, I need to display project effective_date.
- his designation changes, I need to display designation effective_date but with the project he worked on during this designation change