Hi,
I have a sample table below:
ID NAME CONTRACT_START_DATE CONTRACT_END_DATE
1234 ABC 2019-01-01 2019-06-30
1234 ABC 2019-06-15 2019-12-31
1222 DEF 2019-01-01
1234 ABC 2020-01-03
I have been assigned to retreive list of staff who has been rehire within 7 days from his/her last contract date, along with number of contract awarded to satff in the past.
The output query will look like
ID Name Contract_Start_Date Number of last awarded contract
1234 ABC 2020-01-03 2
Best regards
SAM
