First off .. new at this ...
I have a sql query against a single table let call it employee, and the employee can work in multiple divisions over time.
Given the data set below in Fig 1 I want to create a table that returns the following .
I want the Maximum date and the division for each unique employee_id ( Fig 2 )
I tried some things but they did not work.
Thanks in advance for your assistance !
( Fig 2 )
employee_id division file_dt
77308036 DVHR 2020-01-30
77312457 DV0063 2021-05-26
77382856 DV0056 2021-05-26
( Fig 1 )
employee_id division file_dt
77308036 DVHR 2020-01-30
77312457 DV0063 2021-05-26
77312457 DV0066 2019-05-09
77312457 DV0058 2019-05-09
77382856 DV0056 2021-05-26
77382856 DV0063 2019-05-09
77382856 DVEIM 2019-05-09