Fraser MacKenzie wrote:
> Sure you can do this. I do it all the time. Here is the select
> select MAX(latest) from MyTable where username='MyUsername';
Ok, but the question was;
"How do I return the most recent row for a given xxx?"
With your solution I would have to do two selects;
1. Find Max(Date) for UserName
2. Select row for UserName AND [previously found] Max(Date)
This is not an atomic operation so unless tables are locked,
could result in data inconsistencies...
If it ain't opinionated, it ain't Rich Teer.