We have a history table which is defined as follows:
--ID (pk) -----------Object ID--------------Work ID--------date------
1 1111 AAAA 1/1/2010
2 1111 AAAA 1/2/2010
3 2222 BBBB 1/1/2010
4 3333 CCCC 1/1/2010
5 1111 DDDD 1/3/2010
We need the latest (date-based NOT id-based) row PER Work ID. Note that an object ID can have multiple work id’s and we need the latest for EACH work ID.
What we need as our result set:
ID (pk) -----------Object ID--------------Work ID--------date------
2 1111 AAAA 1/2/2010
3 2222 BBBB 1/1/2010
4 3333 CCCC 1/1/2010
5 1111 DDDD 1/3/2010
Thoughts/Ideas?
1 Answer