Hello All,
I have a requirement from the below Table
I need Count of Promoted and Not_promoted Managers with their last 3 phases for each of managers and sort them by ascending order of Manager ID. Result should look like the below one -
to explain the above one,
example - Manager_ID =10 he got promoted on ( 1st March, 15th March, 23rd March) , Not promoted on (None) , so Under promoted count would be 3 and Not Promoted count would be 0
Under First,Second and Third phase , these three are split accordingly. Similarly others too.
I tried to use Rank over function and tried but I'm unable to get desired output. Can someone please help me with the query to build result set please.
Appreciate your help in Advance
sql query test.xlsx (9.38 KB)