I have a table of people records like this:
Tableid PeopleID DeptID StartMonth StartYear
--------------------------------------------
1 101 1 3 2014
2 101 2 2 2015
3 102 2 5 2015
4 102 5 4 2013
5 103 6 8 2015
6 103 7 9 2015
I want only the lastest workhistory for each peopleid with the corresponding tableid, meaning I want to have the following output:
tableid peopleid
2 101
3 102
6 103
Here I require only tableid and peopleid in output.