So I have some data as follows:
ID status date
001 happy 01-01-2021
001 sad 01-02-2021
002 angry 01-03-2021
003 sad 01-04-2021
004 happy 01-05-2021
003 happy 01-05-2021
004 happy 01-06-2021
And all I want to do is have a table with unique ID and the status on their most recent date.
Final Output:
ID status date
001 sad 01-02-2021
002 angry 01-03-2021
003 happy 01-05-2021
004 happy 01-06-2021
I know how to do this with a row_number PARTITION but this is very computationally taxing. Any other method of which I can accomplish the above?