=================
ID - Date - Note
3 - 1/1/2014 - happy
3 - 2/1/2014 - mad
3 - 3/1/2014 - sad
4 - 1/1/2014 - mad
4 - 2/1/2014 - happy
=================
Would like to return the latest date per ID as well as associated Note. Results would look like this:
=================
ID - Date - Note
3 - 3/1/2014 - sad
4 - 2/1/2014 - happy
=================
I can group by ID and then select the max(Date). However, I can't get the associated Note as no aggregate function is applicable. I just want: "the note associated with the Id/date I selected via the max function."
I don't know the official or proper or efficient way to do it. It feels like i'm hacking it by rejoining the aggregate query back into the original data set. Any help would be greatly appreciated as i constantly run into this issue.