bizproducer
Programmer
I need help with a query... this is what my data looks like:
ID AccountID Date
1 893999 031104
2 893999 021104
3 893999 021104
4 893999 041104
5 893999 041104
6 708854 121104
7 708854 121104
8 708854 101104
Basically, I want to only get the records with the most recent dates for each account ID, and as you can see each account ID can have multiple dates that are the most recent and the same. I have messed with correlated subqueries, distinct, max and I can't get the dataset returned. This is what I want to get:
ID AccountID Date
4 893999 041104
5 893999 041104
6 708854 121104
7 708854 121104
HELP! I am pulling my hair out over this!
ID AccountID Date
1 893999 031104
2 893999 021104
3 893999 021104
4 893999 041104
5 893999 041104
6 708854 121104
7 708854 121104
8 708854 101104
Basically, I want to only get the records with the most recent dates for each account ID, and as you can see each account ID can have multiple dates that are the most recent and the same. I have messed with correlated subqueries, distinct, max and I can't get the dataset returned. This is what I want to get:
ID AccountID Date
4 893999 041104
5 893999 041104
6 708854 121104
7 708854 121104
HELP! I am pulling my hair out over this!