Todd Biggins (3/27/2008)
Brain freeze! Using the following example:Lastname FirstName DateModified
Smith Jim 1/14/07
Smith Jim 2/28/08
Richardson Alex 5/15/07
Richardson Alex 7/05/07
etc...
How can I return only the latest date modified (aka exclude the older dates modified)?
(I'll be using the resulting dates modified from the subset to match against an original table)
I think this is what you are looking for:
select
Lastname,
Firstname,
max(DateModified) as DateModified
from
dbo.MyTable
group by
Lastname,
Firstname
😎